mirror of
https://github.com/harish2704/installer-scripts.git
synced 2026-09-10 06:11:08 +00:00
Refactor
This commit is contained in:
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo $0 $1 $2 $3;
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
cat<<EEE
|
||||
installer-scripts --update | --install <app_name> | --list
|
||||
EEE
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
. $(dirname $(readlink -f $0))/../lib/installer_common;
|
||||
|
||||
printPackages(){
|
||||
cd $appDir/installer-scripts/packages;
|
||||
ls;
|
||||
}
|
||||
|
||||
case $1 in
|
||||
--update)
|
||||
updateSelf;
|
||||
;;
|
||||
|
||||
--list)
|
||||
printPackages;
|
||||
;;
|
||||
|
||||
--install)
|
||||
installPackage;
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
|
||||
@@ -19,14 +19,14 @@ performDownloads(){
|
||||
|
||||
doInstall(){
|
||||
|
||||
for i in $extractedName $installationPath; do
|
||||
for i in $appName $installationPath; do
|
||||
if [ -d "$i" ]; then
|
||||
rm -rf "$i"
|
||||
fi
|
||||
done
|
||||
installPack;
|
||||
cd "$installTmp";
|
||||
mv "$extractedName" "$installationPath";
|
||||
mv "$appName" "$installationPath";
|
||||
}
|
||||
|
||||
mainInstaller(){
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
. $(dirname $(readlink -f $0))/installer_common;
|
||||
export extractedName='node-v0.12.7-linux-x64';
|
||||
export installationPath="$appDir/$extractedName";
|
||||
export appName='node-v0.12.7-linux-x64';
|
||||
export installationPath="$appDir/$appName";
|
||||
|
||||
downloadPack(){
|
||||
wget -c 'https://nodejs.org/dist/v0.12.7/node-v0.12.7-linux-x64.tar.gz';
|
||||
@@ -10,7 +10,7 @@ downloadPack(){
|
||||
|
||||
installPack(){
|
||||
tar -xzvf 'node-v0.12.7-linux-x64.tar.gz';
|
||||
cd "$extractedName";
|
||||
cd "$appName";
|
||||
find ./bin -type f -or -type l -executable > 'binaries.lst';
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
. $(dirname $(readlink -f $0))/installer_common;
|
||||
export extractedName='installer-scripts-master';
|
||||
export installationPath="$appDir/$extractedName";
|
||||
export appName='installer-scripts';
|
||||
export installationPath="$appDir/$appName";
|
||||
|
||||
downloadPack(){
|
||||
wget -c 'https://github.com/harish2704/installer-scripts/archive/master.zip';
|
||||
@@ -10,7 +9,8 @@ downloadPack(){
|
||||
|
||||
installPack(){
|
||||
unzip 'master.zip'
|
||||
cd "$extractedName";
|
||||
mv 'installer-scripts-master' "$appName";
|
||||
cd "$appName";
|
||||
# find ./ -type f -or -type l -executable > 'binaries.lst';
|
||||
touch 'binaries.lst';
|
||||
}
|
||||
Reference in New Issue
Block a user