* Fix the logic of _generic installation script

* Add a fallback option to install from any git repository URL ( including local one )
This commit is contained in:
2020-01-06 13:44:47 +05:30
parent d2ec58fd6e
commit b9ee447dee
2 changed files with 13 additions and 7 deletions
+4 -6
View File
@@ -18,12 +18,10 @@ performDownloads(){
} }
doInstall(){ doInstall(){
# Remove application dir if it already exists in installation path
for i in $appName $installationPath; do if [ -d "$installationPath" ]; then
if [ -d "$i" ]; then rm -rf "$installationPath"
rm -rf "$i" fi
fi
done
installPack; installPack;
cd "$installTmp"; cd "$installTmp";
mv "$appName" "$installationPath"; mv "$appName" "$installationPath";
+9 -1
View File
@@ -25,6 +25,15 @@ downloadUrl(){
export appName="${repo}-${version}" export appName="${repo}-${version}"
export installationPath="$appDir/$appName"; export installationPath="$appDir/$appName";
wget -c "https://github.com/$username/$repo/archive/${version}.zip" -O "${appName}.zip" wget -c "https://github.com/$username/$repo/archive/${version}.zip" -O "${appName}.zip"
unzip "${appName}.zip";
;;
*)
echo "Cloning git repository from $url in $PWD"
export appName=$(basename "$url")
export installationPath="$appDir/$appName";
echo "installationPath = $installationPath"
if [ -d "$appName" ]; then rm -rf "$appName"; fi
git clone "$url"
;; ;;
esac esac
@@ -36,7 +45,6 @@ downloadPack(){
} }
installPack(){ installPack(){
unzip "${appName}.zip";
cd $appName; cd $appName;
./install.sh; ./install.sh;
} }