Skip to content

Commit

Permalink
test: use parse_opts from lib
Browse files Browse the repository at this point in the history
  • Loading branch information
miallo committed Jan 12, 2024
1 parent 6fc2d0e commit 6fa23e2
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,14 @@ set -e

: "${verbose:=0}"

create_challenge_flags=("--force")
while [ $# -gt 0 ]; do
opt="$1"; shift
case "$opt" in
-v|--verbose)
verbose=$((verbose + 1))
create_challenge_flags+=("-v")
;;
*)
echo "ERROR! Unknown option '$opt'. Useage: $0 [-v|--verbose] [-f|--force|--delete-existing-challenge]" >&2
exit 1
;;
esac
done
. ./lib.sh

parse_opts "$@"

. ./test_helpers/lib-test.sh
build_challenge() {
echo "Building challenge..."
./create_challenge.sh "${create_challenge_flags[@]}"
./create_challenge.sh --force
}
build_challenge
cd challenge
Expand Down

0 comments on commit 6fa23e2

Please sign in to comment.