cask update script

This commit is contained in:
Kyle Spearrin 2018-02-19 22:50:16 -05:00
parent ed9e49ab70
commit 0213c19dc0
1 changed files with 29 additions and 0 deletions

29
scripts/cask-update.sh Normal file
View File

@ -0,0 +1,29 @@
# dependencies:
# brew install jq
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="$DIR/.."
DIST_DIR="$ROOT_DIR/dist"
CASK_DIR="$ROOT_DIR/stores/homebrew-cask"
DIST_CASK_DIR="$DIST_DIR/homebrew-cask"
cp -r ./SourceFolder ./DestFolder
if [ ! -d "$DIST_CASK_DIR" ]
then
rm -rf $DIST_CASK_DIR
fi
cp -r $CASK_DIR $DIST_CASK_DIR
SRC_PACKAGE="$ROOT_DIR/src/package.json";
SRC_PACAKGE_VERSION=(jq 'version' SRC_PACKAGE)
ZIP="$DIST_DIR\Bitwarden-$SRC_PACAKGE_VERSION-mac.zip"
CHECKSUM=(shasum -a 256 $ZIP)
CHECKPOINT=(brew cask _appcast_checkpoint --calculate "https://github.com/bitwarden/desktop/releases.atom")
RB="$DIST_CASK_DIR/bitwarden.rb"
sed -i -e 's/__version__/'"$SRC_PACAKGE_VERSION"'/g' $RB
sed -i -e 's/__checksum__/'"$CHECKSUM"'/g' $RB
sed -i -e 's/__checkpoint__/'"$CHECKPOINT"'/g' $RB