Skip to content

Commit

Permalink
Move full deletion notice in remove.sh
Browse files Browse the repository at this point in the history
So that the information shows up in removal dry-run workflow outputs if needed (where the WARNING line and anything after is not shown).
  • Loading branch information
dzuelke committed May 30, 2024
1 parent 6561219 commit 769224c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions support/build/_util/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -249,24 +249,24 @@ if [[ $localdst ]] || (( !${#run_manifests_cp[@]} && !${#run_manifests_rm[@]} ))
exit
fi

cat >&2 <<-EOF
WARNING: POTENTIALLY DESTRUCTIVE ACTION!
EOF

(cd "$dst_tmp"; shopt -s nullglob; manifests=( *.composer.json ); (( ${#manifests[@]} < 1 )) ) && {
wipe=true
prompt="Are you sure you want to remove all packages from destination?"
cat >&2 <<-EOF
THE REMOVALS ABOVE WILL DELETE THIS REPOSITORY IN ITS ENTIRETY!
THIS REPOSITORY'S packages.json WOULD BE EMPTY, SO IT WILL BE REMOVED AS WELL!
THE RESULTING EMPTY packages.json WILL BE REMOVED AS WELL!
EOF
} || {
wipe=false
prompt="Are you sure you want to sync to destination & re-generate packages.json?"
}

cat >&2 <<-EOF
WARNING: POTENTIALLY DESTRUCTIVE ACTION!
EOF

read -p "${prompt} [yN] " proceed

[[ ! $proceed =~ [yY](es)* ]] && exit
Expand Down

0 comments on commit 769224c

Please sign in to comment.