Skip to content

Commit

Permalink
Build: Only prompt clean if unclean (#14352)
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth authored Mar 11, 2019
1 parent 97c07db commit 3e1af34
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions bin/build-plugin-zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,21 @@ fi
# Do a dry run of the repository reset. Prompting the user for a list of all
# files that will be removed should prevent them from losing important files!
status "Resetting the repository to pristine condition. ✨"
git clean -xdf --dry-run
warning "🚨 About to delete everything above! Is this okay? 🚨"
echo -n "[y]es/[N]o: "
read answer
if [ "$answer" != "${answer#[Yy]}" ]; then
# Remove ignored files to reset repository to pristine condition. Previous
# test ensures that changed files abort the plugin build.
status "Cleaning working directory... 🛀"
git clean -xdf
else
error "Fair enough; aborting. Tidy up your repo and try again. 🙂"
exit 1
to_clean=$(git clean -xdf --dry-run)
if [ ! -z "$to_clean" ]; then
echo $to_clean
warning "🚨 About to delete everything above! Is this okay? 🚨"
echo -n "[y]es/[N]o: "
read answer
if [ "$answer" != "${answer#[Yy]}" ]; then
# Remove ignored files to reset repository to pristine condition. Previous
# test ensures that changed files abort the plugin build.
status "Cleaning working directory... 🛀"
git clean -xdf
else
error "Fair enough; aborting. Tidy up your repo and try again. 🙂"
exit 1
fi
fi

# Download all vendor scripts
Expand Down

0 comments on commit 3e1af34

Please sign in to comment.