Skip to content

Commit

Permalink
fix: Allow relative paths for 'cache' and 'dir' options. Fixes #250.
Browse files Browse the repository at this point in the history
  • Loading branch information
williambrode committed May 15, 2024
1 parent 187fb53 commit 82243f5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/volume/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,23 @@ func Mount(workDirHost string, cacheDirHost string) (Volume, error) {
if err != nil {
return Volume{}, err
}
} else {
workDirHost, err = filepath.Abs(workDirHost)
if err != nil {
return Volume{}, fmt.Errorf("could not make the root directory %s an absolute path: %w", workDirHost, err)
}
}

if cacheDirHost == "" {
cacheDirHost, err = DefaultCacheDirHost()
if err != nil {
return Volume{}, err
}
} else {
cacheDirHost, err = filepath.Abs(cacheDirHost)
if err != nil {
return Volume{}, fmt.Errorf("could not make the cache directory %s an absolute path: %w", cacheDirHost, err)
}
}

l := Volume{
Expand Down

0 comments on commit 82243f5

Please sign in to comment.