Przeglądaj źródła

added dev clear functions

Allows devs to wipe functions dir quickly rather than manually
Daniel Gibbs 8 lat temu
rodzic
commit
1619253a1a

+ 14 - 0
lgsm/functions/command_dev_clear_functions.sh

@@ -0,0 +1,14 @@
+#!/bin/bash
+# command_dev_clear_functions.sh function
+# Author: Daniel Gibbs
+# Website: https://linuxgsm.com
+# Description: Deletes the contents of the functions dir.
+
+echo "================================="
+echo "Clear Functions"
+echo "================================="
+echo ""
+if fn_prompt_yn "Do you want to delete all functions?" Y; then
+	rm -rfv "${functionsdir}/*"
+fi
+core_exit.sh

+ 2 - 1
lgsm/functions/core_getopt.sh

@@ -47,6 +47,7 @@ cmd_dev_debug=( "dev;developer" "command_dev_debug.sh" "Enable developer Mode."
 cmd_dev_detect_deps=( "dd;detect-deps" "command_dev_detect_deps.sh" "Detect required dependencies." )
 cmd_dev_detect_deps=( "dd;detect-deps" "command_dev_detect_deps.sh" "Detect required dependencies." )
 cmd_dev_detect_glibc=( "dg;detect-glibc" "command_dev_detect_glibc.sh" "Detect required glibc." )
 cmd_dev_detect_glibc=( "dg;detect-glibc" "command_dev_detect_glibc.sh" "Detect required glibc." )
 cmd_dev_detect_ldd=( "dl;detect-ldd" "command_dev_detect_ldd.sh" "Detect required dynamic dependencies." )
 cmd_dev_detect_ldd=( "dl;detect-ldd" "command_dev_detect_ldd.sh" "Detect required dynamic dependencies." )
+cmd_dev_clear_functions=( "cf;clear-functions" "command_dev_clear_functions.sh" "Delete the contents of the functions dir." )
 
 
 ### Set specific opt here ###
 ### Set specific opt here ###
 
 
@@ -130,7 +131,7 @@ currentopt+=( "${cmd_install[@]}" "${cmd_auto_install[@]}" )
 ## Developer commands
 ## Developer commands
 currentopt+=( "${cmd_dev_debug[@]}" )
 currentopt+=( "${cmd_dev_debug[@]}" )
 if [ -f ".dev-debug" ]; then
 if [ -f ".dev-debug" ]; then
-	currentopt+=(  "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" )
+	currentopt+=(  "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_clear_functions[@]}" )
 fi
 fi
 
 
 ### Build list of available commands
 ### Build list of available commands