Skip to content

Commit

Permalink
fix: use full path for running black to allow older versions of docker (
Browse files Browse the repository at this point in the history
#1666)

## Description:
Some users were reporting bugs re volume names; this should patch it as
we won't ever have `.:`

## Is this change user facing?
YES
  • Loading branch information
h4ck3rk3y authored Oct 31, 2023
1 parent b70e40e commit fdcd3d9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cli/cli/commands/lint/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"os"
"os/exec"
"path"
"path/filepath"
)

const (
Expand Down Expand Up @@ -154,9 +155,14 @@ func getVolumeToMountAndPathToLint(pathOfFileOrDirToLint string) (string, string
if err != nil {
return "", "", stacktrace.Propagate(err, "an error occurred while verifying that '%v' exist", pathOfFileOrDirToLint)
}
absolutePathForFileOrDirToLint, err := filepath.Abs(pathOfFileOrDirToLint)
if err != nil {
return "", "", stacktrace.Propagate(err, "tried to get absolute path for dir to lint '%v but failed'", absolutePathForFileOrDirToLint)
}

if fileInfo.IsDir() {
return pathOfFileOrDirToLint, presentWorkingDirectory, nil
return absolutePathForFileOrDirToLint, presentWorkingDirectory, nil
} else {
return path.Dir(pathOfFileOrDirToLint), path.Base(pathOfFileOrDirToLint), nil
return path.Dir(absolutePathForFileOrDirToLint), path.Base(absolutePathForFileOrDirToLint), nil
}
}

0 comments on commit fdcd3d9

Please sign in to comment.