blob: 0c1ee10ce43ea8f0700710d9f199ec1ea4b0600b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#!/bin/sh
if [ $# -ne 1 ]; then
echo "usage: rm <name>"
exit 1
fi
base_dir="$HOME"
target="$1"
case $target in
*\.git)
;;
*)
target="${target}.git"
;;
esac
if [ -d "$target" ]; then
printf "Really delete? [y/N] "
read -r confirm
if [ "${confirm,,}" = "y" ]; then
rm -rf "${base_dir:?}/${target:?}" \
&& echo "${target} deleted"
fi
fi
|