Skip to content

Commit

Permalink
FIx: Do not shift non-exist args
Browse files Browse the repository at this point in the history
  • Loading branch information
Hayao0819 committed Nov 6, 2023
1 parent 1b53435 commit af885cc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions devtools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ main() {
case "${_cmd-""}" in
"init")
init_command "$@"
shift 1
shift 1 || true
;;
"bump")
bump_command "$@"
shift 1
shift 1 || true
;;
"help")
print_usage
shift 1
shift 1 || true
exit 0
;;
"")
Expand All @@ -115,11 +115,11 @@ main() {
exit 1
;;
*)
_cmdargs="${_cmdargs-""}${1} "
shift 1
echo "Unknown command: ${_cmd}" >&2
print_usage >&2
exit 1
;;
esac
eval set -- "${_cmdargs-""}"
}

main "$@"

0 comments on commit af885cc

Please sign in to comment.