소스 검색

Fix default for simple args

bryan 1 개월 전
부모
커밋
24f54b0302
1개의 변경된 파일5개의 추가작업 그리고 6개의 파일을 삭제
  1. 5 6
      installJRMC

+ 5 - 6
installJRMC

@@ -240,15 +240,14 @@ init() {
     USER="${SUDO_USER:-$USER}"
   fi
 
-  # Set default command arguments and/or parse user input
+  # Parse input commands with getopt
   if [[ $# -eq 0 || ! "$*" =~ (--install|--service|--container|--createrepo) ]]; then
     debug "Automatically using --install=repo"
-    REPO_INSTALL_SWITCH=1
+    declare -gi REPO_INSTALL_SWITCH=1
+  else
+    parse_input "$@"
   fi
-  
-  # Parse input commands with getopt
-  [[ $# -gt 0 ]] && parse_input "$@"
-  
+
   # Run the self-updater if enabled
   ((UPDATE_SWITCH)) && update "$@"