Skip to content

Commit

Permalink
change bash shebangs to be more portable
Browse files Browse the repository at this point in the history
When running kubectl-neat tests on a nixos system, I was getting test
failures like the following:

```
--- FAIL: TestGetCmd (0.00s)
    cmd_test.go:186: error assertion: have: &errors.errorString{s:"Error invoking kubectl as [../test/kubectl-stub get -o json pods] fork/exec ../test/kubectl-stub:
 no such file or directory"}
        test case: {[pods] 0x1021740 apiVersion }
```

And running the script directly:

```
$ ./test/kubectl-stub
zsh: ./test/kubectl-stub: bad interpreter: /bin/bash: no such file or directory
```

This PR changes the shebang to `#!/usr/bin/env bash` to make the tests
more portable across systems. I changed the other bash shebangs for good
measure.
  • Loading branch information
ryane authored and itaysk committed Jul 29, 2023
1 parent 4c647f3 commit 6c5ae56
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hack/update-kubernetes-deps.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

VERSION=${1#"v"}
if [ -z "$VERSION" ]; then
Expand Down
2 changes: 1 addition & 1 deletion krew-package.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/bash
#!/usr/bin/env bash
# This script makes a platform specific krew package
# it assumes goreleaser had already run and created the archives and the checksums
# Arguments:
Expand Down
2 changes: 1 addition & 1 deletion test/kubectl-stub
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# based on Argbash: https://argbash.io

Expand Down

0 comments on commit 6c5ae56

Please sign in to comment.