2016-02-16 05:00:24 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
lbrycrd_directory="/Users/${SUDO_USER}/Library/Application Support/lbrycrd"
|
|
|
|
|
|
|
|
current_version=$(git ls-remote https://github.com/jackrobison/lbrynet-app.git | grep HEAD | cut -f 1)
|
|
|
|
|
|
|
|
if [ -d "$lbrycrd_directory" ]; then
|
|
|
|
if [ -f "${lbrycrd_directory}/lbry_app_version.txt" ]; then
|
|
|
|
if grep -Fxq "$current_version" "${lbrycrd_directory}/lbry_app_version.txt"; then
|
|
|
|
echo "LBRY version $current_version is up to date"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2016-02-22 16:05:55 +01:00
|
|
|
if ! brew list berkeley-db4 &>/dev/null; then
|
|
|
|
echo "Installing berkeley-db4"
|
|
|
|
sudo -u ${SUDO_USER} brew install https://rawgit.com/jackrobison/homebrew/master/Library/Formula/berkeley-db4.rb &>/dev/null
|
|
|
|
sudo -u ${SUDO_USER} brew link --force berkeley-db4 &>/dev/null
|
|
|
|
else
|
|
|
|
echo "berkeley-db4 already installed"
|
|
|
|
fi
|
|
|
|
|
2016-02-16 05:00:24 +01:00
|
|
|
tmp=$(mktemp -d)
|
|
|
|
cd $tmp
|
|
|
|
|
2016-02-16 16:25:15 +01:00
|
|
|
echo "Downloading LBRY update"
|
|
|
|
git clone --depth 1 https://github.com/jackrobison/lbrynet-app.git &>/dev/null
|
2016-02-16 05:00:24 +01:00
|
|
|
cd lbrynet-app
|
|
|
|
unzip LBRY.app.zip &>/dev/null
|
|
|
|
unzip LBRYURIHandler.app.zip &>/dev/null
|
|
|
|
unzip LBRY\ Updater.app.zip &>/dev/null
|
|
|
|
|
|
|
|
echo "Installing update"
|
2016-02-16 15:09:50 +01:00
|
|
|
|
|
|
|
mkdir -p "$lbrycrd_directory"
|
|
|
|
echo $current_version > "${lbrycrd_directory}/lbry_app_version.txt"
|
|
|
|
|
2016-02-16 05:00:24 +01:00
|
|
|
rm -rf /Applications/LBRY.app &>/dev/null
|
|
|
|
rm -rf /Applications/LBRYURIHandler.app &>/dev/null
|
|
|
|
rm -rf /Applications/LBRY\ Updater.app &>/dev/null
|
|
|
|
|
|
|
|
mv -f LBRY.app /Applications
|
|
|
|
mv -f LBRYURIHandler.app /Applications
|
|
|
|
mv -f LBRY\ Updater.app /Applications
|
|
|
|
|
|
|
|
echo "Cleaning up"
|
|
|
|
|
|
|
|
cd ../../
|
|
|
|
rm -rf $tmp
|