From ce23cf89b9958cc0f9113fe222eea333e0f953da Mon Sep 17 00:00:00 2001 From: William Hilton Date: Mon, 2 Nov 2015 00:09:14 -0500 Subject: [PATCH] Improve 'rm' command --- bin/get | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/bin/get b/bin/get index 4da975e..83c3c1b 100755 --- a/bin/get +++ b/bin/get @@ -81,8 +81,23 @@ add) ;; rm) -echo Removing -git rm "$2" +echo Removing tracked files +git rm -r "$2" +# Check to see if there are still remaining files +if [ -d "$2" ] +then + # Prompt user to delete untracked files + read -n 1 -p "Would you like to delete the untracked files as well? [Y/n]: " answer + echo -e '\n' + answer=${answer:-Y} + case "$answer" in + [Yy] ) + rm -Rf "$2" + ;; + [Nn] ) + ;; + esac +fi ;; reset)