mirror of
https://github.com/harish2704/installer-scripts.git
synced 2026-09-10 06:11:08 +00:00
adding support for generic packages hosted in github
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
export appName
|
||||
|
||||
downloadUrl(){
|
||||
url=$1;
|
||||
host='';
|
||||
repo='';
|
||||
tree='';
|
||||
|
||||
case $url in
|
||||
https://github.com/*)
|
||||
host='github.com';
|
||||
url=${url#https://github.com/};
|
||||
|
||||
username=${url%%/*}
|
||||
url=${url#*/}
|
||||
|
||||
repo=${url%%/*}
|
||||
url=${url#*/}
|
||||
|
||||
version=${url%%/*}
|
||||
if [ $version = $url ]; then version='master'; fi;
|
||||
|
||||
export appName="${repo}-${version}"
|
||||
export installationPath="$appDir/$appName";
|
||||
wget -c "https://github.com/$username/$repo/archive/${version}.zip" -O "${appName}.zip"
|
||||
;;
|
||||
esac
|
||||
|
||||
}
|
||||
|
||||
|
||||
downloadPack(){
|
||||
downloadUrl $packageName
|
||||
}
|
||||
|
||||
installPack(){
|
||||
unzip "${appName}.zip";
|
||||
cd $appName;
|
||||
./install.sh;
|
||||
}
|
||||
Reference in New Issue
Block a user