Skip to content

Commit

Permalink
Also check if tools/bazel is a directory (#148)
Browse files Browse the repository at this point in the history
If `tools/bazel` is a directory, the `maybeDelegateToWrapper` function
tries to execute it, which results in a permission denied error.

This commit prevents that by checking if `tools/bazel` is a directory and ignores it.
  • Loading branch information
Kiougar authored Aug 11, 2020
1 parent ec60132 commit 297a40a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bazelisk.go
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ func maybeDelegateToWrapper(bazel string) string {

root := findWorkspaceRoot(wd)
wrapper := filepath.Join(root, wrapperPath)
if stat, err := os.Stat(wrapper); err != nil || stat.Mode().Perm()&0001 == 0 {
if stat, err := os.Stat(wrapper); err != nil || stat.IsDir() || stat.Mode().Perm()&0001 == 0 {
return bazel
}

Expand Down

0 comments on commit 297a40a

Please sign in to comment.