Improve git update handling
This commit is contained in:
parent
37d49a990c
commit
72603c5bef
3 changed files with 15 additions and 12 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -18,8 +18,8 @@ obj/
|
|||
git-*
|
||||
Sparkles/InstallationInfo.Directory.cs
|
||||
SparkleShare/Linux/sparkleshare
|
||||
SparkleShare/Mac/git/*
|
||||
SparkleShare/Mac/git*
|
||||
SparkleShare/Mac/*.tar.gz
|
||||
/sparkleshare-*
|
||||
desktop.ini
|
||||
_ReSharper.*
|
||||
|
|
|
@ -11,6 +11,8 @@ function abspath()
|
|||
esac
|
||||
}
|
||||
|
||||
export projectFolder=$(dirname $0)
|
||||
export projectFolder=$(abspath ${projectFolder})
|
||||
|
||||
LINE=$(cat ${projectFolder}/git.download)
|
||||
TMP=()
|
||||
|
@ -19,23 +21,22 @@ for val in $LINE ; do
|
|||
TMP+=("$val")
|
||||
done
|
||||
|
||||
export projectFolder=$(dirname $0)
|
||||
export projectFolder=$(abspath ${projectFolder})
|
||||
export gitDownload="${TMP[0]}"
|
||||
export gitName=${gitDownload##*/}
|
||||
export gitSHA256="${TMP[1]}"
|
||||
|
||||
|
||||
set -e
|
||||
|
||||
|
||||
if [ ! -f ${projectFolder}/git.tar.gz ]
|
||||
if [[ ! -f ${projectFolder}/${gitName} ]];
|
||||
then
|
||||
curl --silent --location ${gitDownload} > git.tar.gz
|
||||
test -e git.tar.gz || { echo "Failed to download git"; exit 1; }
|
||||
curl --silent --location ${gitDownload} > ${gitName}
|
||||
test -e ${gitName} || { echo "Failed to download git"; exit 1; }
|
||||
|
||||
printf "${gitSHA256} git.tar.gz" | shasum --check --algorithm 256
|
||||
printf "${gitSHA256} ${gitName}" | shasum --check --algorithm 256
|
||||
|
||||
mkdir git/
|
||||
tar xzf git.tar.gz --directory git/
|
||||
tar czf git.tar.gz git/
|
||||
rm -rf git/
|
||||
fi
|
||||
|
||||
rm git.tar.gz
|
||||
ln -s $gitName git.tar.gz
|
||||
|
|
|
@ -9,6 +9,8 @@ echo Postprocessing ${bundle}...
|
|||
export PATH=/usr/local/bin:/opt/local/bin:/Library/Frameworks/Mono.framework/Versions/Current/bin:/usr/bin:/bin
|
||||
|
||||
${projectFolder}/checkGit.sh
|
||||
tar -x -f ${projectFolder}/git.tar.gz --directory ${bundle}/Contents/Resources
|
||||
rm -rf ${bundle}/Contents/Resources/git
|
||||
mkdir ${bundle}/Contents/Resources/git
|
||||
tar -x -f ${projectFolder}/git.tar.gz --directory ${bundle}/Contents/Resources/git
|
||||
cp -R SparkleShareInviteOpener.app ${bundle}/Contents/Resources
|
||||
cp config ${bundle}/Contents/MonoBundle
|
||||
|
|
Loading…
Add table
Reference in a new issue