Skip to content

Commit

Permalink
improving arg handling and messages
Browse files Browse the repository at this point in the history
  • Loading branch information
truib committed Oct 2, 2023
1 parent 6153ed1 commit 1f9c0da
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cleanup_pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ done
# restore potentially parsed filename(s) into $*
set -- "${POSITIONAL_ARGS[@]}"

if [[ $# -lt 1 ]]; then
echo "Error: no PR number provided"
if [[ $# -ne 1 ]]; then
echo "Error: exactly one PR number should be provided as argument"
display_help
exit 3
fi
Expand Down Expand Up @@ -127,6 +127,7 @@ do
if ${dry_run} = true ; then
echo "DRY_RUN: rm '$f' ($(ls -lh $f | awk '{print $5}'))"
else
echo "Removing file '$f'"
rm $f
fi
done
Expand All @@ -145,6 +146,7 @@ do
if ${dry_run} = true ; then
echo "DRY_RUN: rm '$f' ($(ls -lh $f | awk '{print $5}'))"
else
echo "Removing file '$f'"
rm $f
fi
done
Expand Down

0 comments on commit 1f9c0da

Please sign in to comment.