22 lines
471 B
Text
22 lines
471 B
Text
|
#!/bin/bash
|
||
|
set -euo pipefail
|
||
|
IFS=$'\n'
|
||
|
|
||
|
cd ~git
|
||
|
source git-shell-commands/util.sh
|
||
|
arguments 1 "$#"
|
||
|
|
||
|
origin="$(repo_name_existing "$1")"
|
||
|
|
||
|
if [ -L "$origin" ]; then
|
||
|
printf '%s\n' "Removed '$origin' (symlink, not asking for confirmation)."
|
||
|
rm -rf "$origin"
|
||
|
else
|
||
|
printf '%s' "Are you sure you want to delete '$origin'? (y/N) "
|
||
|
read confirm
|
||
|
case $confirm in
|
||
|
y*|Y*) rm -rf "$origin"; printf '%s\n' "Removed '$origin'."; ;;
|
||
|
*) printf '%s\n' "Cancelling."; ;;
|
||
|
esac
|
||
|
fi
|