Tilde expansion for path parameters is slot configuration strings

This commit is contained in:
Iván Izaguirre 2024-03-09 19:22:04 +01:00
parent a4ad599056
commit 30e3a7503d
1 changed files with 8 additions and 0 deletions

View File

@ -39,6 +39,14 @@ func LoadResource(filename string) ([]uint8, bool, error) {
filename = filename[1 : len(filename)-1]
}
// Expand the tilde if prefixed by it
if strings.HasPrefix(filename, "~") {
home, err := os.UserHomeDir()
if err == nil {
filename = home + filename[1:]
}
}
var writeable bool
var file io.Reader
if isInternalResource(filename) {