Skip to content

Commit

Permalink
Tilde expansion for path parameters is slot configuration strings
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanizag committed Mar 9, 2024
1 parent a4ad599 commit 30e3a75
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 30e3a75

Please sign in to comment.