Skip to content

Commit

Permalink
Use IsAbs to check for absolute path in cross platform way
Browse files Browse the repository at this point in the history
  • Loading branch information
rkoster committed May 6, 2024
1 parent cec4f47 commit 6cd2210
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions releasedir/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package releasedir

import (
"path/filepath"
"strings"

"code.cloudfoundry.org/clock"
boshblob "github.com/cloudfoundry/bosh-utils/blobstore"
Expand Down Expand Up @@ -114,7 +113,7 @@ func (p Provider) newBlobstore(dirPath string) boshblob.DigestBlobstore {
switch provider {
case "local":
blobstorePath, found := options["blobstore_path"].(string)
if found && !strings.HasPrefix(blobstorePath, "/") {
if found && !filepath.IsAbs(blobstorePath) {
options["blobstore_path"] = filepath.Join(dirPath, blobstorePath)
}
blobstore = boshblob.NewLocalBlobstore(p.fs, p.uuidGen, options)
Expand Down

0 comments on commit 6cd2210

Please sign in to comment.