You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
992 B

#!/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"
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
}
downloadPack(){
downloadUrl $packageName
}
installPack(){
cd $appName;
./install.sh;
}