mirror of
https://github.com/harish2704/installer-scripts.git
synced 2026-09-10 06:11:08 +00:00
Refactor
This commit is contained in:
+12
-1
@@ -9,13 +9,24 @@ EEE
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
. $(dirname $(readlink -f $0))/../lib/installer_common;
|
||||
appRoot=$(readlink -f $(dirname $(readlink -f $0))/.. );
|
||||
. "$appRoot/lib/installer_common";
|
||||
|
||||
printPackages(){
|
||||
cd $appDir/installer-scripts/packages;
|
||||
ls;
|
||||
}
|
||||
|
||||
updateSelf(){
|
||||
$0 --install self;
|
||||
}
|
||||
|
||||
installPackage(){
|
||||
packageName=$2;
|
||||
. "$appRoot/packages/$packageName";
|
||||
mainInstaller;
|
||||
}
|
||||
|
||||
case $1 in
|
||||
--update)
|
||||
updateSelf;
|
||||
|
||||
@@ -29,13 +29,6 @@ doInstall(){
|
||||
mv "$appName" "$installationPath";
|
||||
}
|
||||
|
||||
mainInstaller(){
|
||||
checkPaths;
|
||||
performDownloads;
|
||||
doInstall;
|
||||
updateBinLinks;
|
||||
}
|
||||
|
||||
updateBinLinks(){
|
||||
cd $localBinDir;
|
||||
for i in $(find "$appDir" -name 'binaries.lst'); do
|
||||
@@ -45,4 +38,9 @@ updateBinLinks(){
|
||||
done;
|
||||
}
|
||||
|
||||
|
||||
mainInstaller(){
|
||||
checkPaths;
|
||||
performDownloads;
|
||||
doInstall;
|
||||
updateBinLinks;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
. $(dirname $(readlink -f $0))/installer_common;
|
||||
export appName='node-v0.12.7-linux-x64';
|
||||
export installationPath="$appDir/$appName";
|
||||
|
||||
@@ -15,4 +12,3 @@ installPack(){
|
||||
}
|
||||
|
||||
|
||||
mainInstaller;
|
||||
|
||||
+1
-5
@@ -1,10 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export appName='installer-scripts';
|
||||
export installationPath="$appDir/$appName";
|
||||
|
||||
downloadPack(){
|
||||
wget -c 'https://github.com/harish2704/installer-scripts/archive/master.zip';
|
||||
wget 'https://github.com/harish2704/installer-scripts/archive/master.zip';
|
||||
}
|
||||
|
||||
installPack(){
|
||||
@@ -15,5 +13,3 @@ installPack(){
|
||||
touch 'binaries.lst';
|
||||
}
|
||||
|
||||
|
||||
mainInstaller;
|
||||
|
||||
Reference in New Issue
Block a user