From e7157e450a2bf63bf6a2694b8d41533cecf9b114 Mon Sep 17 00:00:00 2001 From: "Harish.K" Date: Sat, 2 Jan 2016 18:29:50 +0530 Subject: [PATCH] Change command option format --- bin/installer-script.sh | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/bin/installer-script.sh b/bin/installer-script.sh index 14c7fe5..b97ca6b 100755 --- a/bin/installer-script.sh +++ b/bin/installer-script.sh @@ -11,7 +11,13 @@ appRoot=$(readlink -f $(dirname $(readlink -f $0))/.. ); printHelp(){ cat< | --list + installer-scripts [options] + Available commands + update - Self update + check - Check ~/.local/Apps directory for and updates all the links in ~/local/bin directory. + install - Install an application. See 'list-apps' command to list Available applications. + Other than this list, installer-scripts compatible apps can be directly installed from github + list-apps - List installable application names. EOF } @@ -21,29 +27,37 @@ printPackages(){ } updateSelf(){ - $0 --install self; + $0 install self; +} + +checkGeneric(){ + packageName=$1; } installPackage(){ packageName=$1; - . "$appRoot/packages/$packageName"; + if [ -z ${packageName%*/} ];then + . "$appRoot/packages/$packageName"; + else + . "$appRoot/packages/_generic"; + fi mainInstaller; } case $1 in - --update) + update) updateSelf; ;; - --list) + list-apps) printPackages; ;; - --install) + install) installPackage $2; ;; - --check) + check) updateBinLinks; ;; *)