mirror of
https://github.com/monero-project/monero.git
synced 2025-08-22 08:09:36 -04:00
guix: ask for confirmation before deleting files
This commit is contained in:
parent
977dedce2c
commit
348ed19d9c
1 changed files with 15 additions and 0 deletions
|
@ -80,4 +80,19 @@ for precious_dirs_file in "${found_precious_dirs_files[@]}"; do
|
||||||
done < "$precious_dirs_file"
|
done < "$precious_dirs_file"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
output="$(git clean --dry-run -xdff "${exclude_flags[@]}")"
|
||||||
|
|
||||||
|
if [[ -z "${output}" ]]; then
|
||||||
|
echo "Nothing to clean."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "${NO_CONFIRM}" ]]; then
|
||||||
|
echo "${output}"
|
||||||
|
read -p "Confirm deletion [y/N]: " confirm
|
||||||
|
if [[ ! "${confirm}" =~ ^[Yy]$ ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
git clean -xdff "${exclude_flags[@]}"
|
git clean -xdff "${exclude_flags[@]}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue