-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port scripts to strict POSIX implementations (#41)
This commit refactors scripts to pure POSIX implementations. * Testing was done in `dash` on macOS as well as FreeBSD's `sh` shell. * Test cases in `test/*.sh` have been significantly improved. * This is the current recommended version of this script.
- Loading branch information
Showing
9 changed files
with
845 additions
and
451 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env sh | ||
## test/zfs.sh | ||
set -eu | ||
|
||
# check pipefail in a subshell and set if supported | ||
# shellcheck disable=SC3040 | ||
(set -o pipefail 2> /dev/null) && set -o pipefail | ||
|
||
_fakeFIND() { | ||
printf "find %s\n" "$*" | ||
return 0 | ||
} | ||
|
||
_fakeZFS "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env sh | ||
## test/zfs.sh | ||
set -eu | ||
|
||
# check pipefail in a subshell and set if supported | ||
# shellcheck disable=SC3040 | ||
(set -o pipefail 2> /dev/null) && set -o pipefail | ||
|
||
_fakeSSH() { | ||
host=$1 | ||
shift | ||
cmd=$1 | ||
shift | ||
case "$cmd" in | ||
*zfs*) | ||
./zfs.sh "$@" | ||
;; | ||
*) | ||
printf "ssh $host $cmd %s\n" "$*" | ||
;; | ||
esac | ||
return 0 | ||
} | ||
|
||
_fakeSSH "$@" |
Oops, something went wrong.