Browse Source

Change command option format

master
Harish.K 10 years ago
parent
commit
e7157e450a
  1. 28
      bin/installer-script.sh

28
bin/installer-script.sh

@ -11,7 +11,13 @@ appRoot=$(readlink -f $(dirname $(readlink -f $0))/.. );
printHelp(){ printHelp(){
cat<<EOF cat<<EOF
installer-scripts --update | --check | --install <app_name> | --list
installer-scripts <comamnd> [options]
Available commands
update - Self update
check - Check ~/.local/Apps directory for and updates all the links in ~/local/bin directory.
install <app_name> - 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 EOF
} }
@ -21,29 +27,37 @@ printPackages(){
} }
updateSelf(){ updateSelf(){
$0 --install self;
$0 install self;
}
checkGeneric(){
packageName=$1;
} }
installPackage(){ installPackage(){
packageName=$1; packageName=$1;
. "$appRoot/packages/$packageName";
if [ -z ${packageName%*/} ];then
. "$appRoot/packages/$packageName";
else
. "$appRoot/packages/_generic";
fi
mainInstaller; mainInstaller;
} }
case $1 in case $1 in
--update)
update)
updateSelf; updateSelf;
;; ;;
--list)
list-apps)
printPackages; printPackages;
;; ;;
--install)
install)
installPackage $2; installPackage $2;
;; ;;
--check)
check)
updateBinLinks; updateBinLinks;
;; ;;
*) *)

Loading…
Cancel
Save