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(){
|
doInstall(){
|
||||||
|
|
||||||
for i in $extractedName $installationPath; do
|
for i in $appName $installationPath; do
|
||||||
if [ -d "$i" ]; then
|
if [ -d "$i" ]; then
|
||||||
rm -rf "$i"
|
rm -rf "$i"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
installPack;
|
installPack;
|
||||||
cd "$installTmp";
|
cd "$installTmp";
|
||||||
mv "$extractedName" "$installationPath";
|
mv "$appName" "$installationPath";
|
||||||
}
|
}
|
||||||
|
|
||||||
mainInstaller(){
|
mainInstaller(){
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
. $(dirname $(readlink -f $0))/installer_common;
|
. $(dirname $(readlink -f $0))/installer_common;
|
||||||
export extractedName='node-v0.12.7-linux-x64';
|
export appName='node-v0.12.7-linux-x64';
|
||||||
export installationPath="$appDir/$extractedName";
|
export installationPath="$appDir/$appName";
|
||||||
|
|
||||||
downloadPack(){
|
downloadPack(){
|
||||||
wget -c 'https://nodejs.org/dist/v0.12.7/node-v0.12.7-linux-x64.tar.gz';
|
wget -c 'https://nodejs.org/dist/v0.12.7/node-v0.12.7-linux-x64.tar.gz';
|
||||||
@@ -10,7 +10,7 @@ downloadPack(){
|
|||||||
|
|
||||||
installPack(){
|
installPack(){
|
||||||
tar -xzvf 'node-v0.12.7-linux-x64.tar.gz';
|
tar -xzvf 'node-v0.12.7-linux-x64.tar.gz';
|
||||||
cd "$extractedName";
|
cd "$appName";
|
||||||
find ./bin -type f -or -type l -executable > 'binaries.lst';
|
find ./bin -type f -or -type l -executable > 'binaries.lst';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
. $(dirname $(readlink -f $0))/installer_common;
|
export appName='installer-scripts';
|
||||||
export extractedName='installer-scripts-master';
|
export installationPath="$appDir/$appName";
|
||||||
export installationPath="$appDir/$extractedName";
|
|
||||||
|
|
||||||
downloadPack(){
|
downloadPack(){
|
||||||
wget -c 'https://github.com/harish2704/installer-scripts/archive/master.zip';
|
wget -c 'https://github.com/harish2704/installer-scripts/archive/master.zip';
|
||||||
@@ -10,7 +9,8 @@ downloadPack(){
|
|||||||
|
|
||||||
installPack(){
|
installPack(){
|
||||||
unzip 'master.zip'
|
unzip 'master.zip'
|
||||||
cd "$extractedName";
|
mv 'installer-scripts-master' "$appName";
|
||||||
|
cd "$appName";
|
||||||
# find ./ -type f -or -type l -executable > 'binaries.lst';
|
# find ./ -type f -or -type l -executable > 'binaries.lst';
|
||||||
touch 'binaries.lst';
|
touch 'binaries.lst';
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user