commit bb8518814aecb6431936d0e63890e518c167b9fe
parent 40c39a9887912af1fece9835e04de63364c86ab6
Author: Tyler Clark <tyler.clark@foxide.xyz>
Date: Sun, 9 Feb 2025 21:47:07 -0500
Working on base of delete script
Diffstat:
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/scripts/DeleteRepo.sh b/scripts/DeleteRepo.sh
@@ -3,14 +3,15 @@
# This script will automate the removal of git repositories
# arguments available for this script are:
-# -h, --help: Prints a help scree
+# -h, --help: Prints a help screen
# -n, --name: The name of the repo to delete
# -z, --fzf: Enables fzf support for the selection of repo to be deleted (Must have fzf installed on system)
# I should come up with some sort of confirmation for deleting the repo as well
-REPODIR="../Repos"
+REPODIR="./repos"
FZF=0
+NAME=""
help()
{
@@ -21,6 +22,10 @@ help()
deleteRepo()
{
+ if [ -z ${NAME} ]; then
+ rm -r ${REPODIR}/${NAME}.git
+ fi
+
echo "Which repo would you like to delete?"
NUM=1
for i in $( ls ${REPODIR} ); do
@@ -37,7 +42,7 @@ fi
while getopts ":hzn:" f; do
case $f in
- n) NAME=${OPTART};;
+ n) NAME=${OPTARG};;
z) FZF=1;;
h | *) help
exit
@@ -45,3 +50,5 @@ while getopts ":hzn:" f; do
esac
done
shift `expr $OPTIND - 1`
+
+deleteRepo $NAME