-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Run
shfmt
and fix shellcheck errors
- Loading branch information
Showing
4 changed files
with
76 additions
and
73 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
#!/bin/bash | ||
|
||
assert_in_one() { | ||
local option1="$1" | ||
local option2="$2" | ||
local option3="$3" | ||
local long="$4" | ||
local option1="$1" | ||
local option2="$2" | ||
local option3="$3" | ||
local long="$4" | ||
|
||
if [[ "$long" == *"$option1"* || "$long" == *"$option2"* || "$long" == *"$option3"* ]]; then | ||
echo "assertion succeeded: one of the options were found in ${long}" | ||
return 0 | ||
else | ||
echo "assertion failed: none of the options were found in ${long}" | ||
echo -e "options:\n- $option1\n- $option2\n- $option3" | ||
return 1 | ||
fi | ||
if [[ "$long" == *"$option1"* || "$long" == *"$option2"* || "$long" == *"$option3"* ]]; then | ||
echo "assertion succeeded: one of the options were found in ${long}" | ||
return 0 | ||
else | ||
echo "assertion failed: none of the options were found in ${long}" | ||
echo -e "options:\n- $option1\n- $option2\n- $option3" | ||
return 1 | ||
fi | ||
} | ||
assert_in() { | ||
local short="$1" | ||
local long="$2" | ||
# On windows paths use \ and unix uses /, so here we standardize | ||
long="${long//\\//}" | ||
if [[ "$long" == *"$short"* ]]; then | ||
echo "assertion succeeded: ${short} was found in ${long}" | ||
return 0 | ||
else | ||
echo "assertion failed: ${short} not found in ${long}" | ||
return 1 | ||
fi | ||
local short="$1" | ||
local long="$2" | ||
# On windows paths use \ and unix uses /, so here we standardize | ||
long="${long//\\//}" | ||
if [[ "$long" == *"$short"* ]]; then | ||
echo "assertion succeeded: ${short} was found in ${long}" | ||
return 0 | ||
else | ||
echo "assertion failed: ${short} not found in ${long}" | ||
return 1 | ||
fi | ||
} |
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