adding upload script to deploy new zip file

This commit is contained in:
Jeff Morgan 2014-09-13 00:01:59 -07:00
parent 35f84a871b
commit 82efdc71c7
1 changed files with 21 additions and 0 deletions

21
script/upload.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
set -e # Auto exit on error
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $DIR/colors.sh
BASE=$DIR/..
NODE="$BASE/cache/node/bin/node"
VERSION=$($NODE -pe 'JSON.parse(process.argv[1]).version' "$(cat package.json)")
if [ ! command -v s3cmd >/dev/null 2>&1 ]; then
cecho "-----> Installing s3cmd (homebrew required)..." $blue
brew install s3cmd
fi
if [ ! -f $BASE/dist/osx/Kitematic-$VERSION.zip ]; then
cecho "-----> dist/osx/Kitematic-$VERSION.zip not found. Try running dist.sh first..." $red
exit 1;
fi
s3cmd put dist/osx/Kitematic-$VERSION.zip s3://kite-installer/Kitematic-$VERSION.zip