1
0
mirror of https://github.com/twitter/twemoji.git synced 2024-11-05 02:30:18 +00:00
twemoji/scripts/deploy.sh

27 lines
692 B
Bash
Raw Normal View History

#!/bin/bash
ROOT=$(
cd $(dirname $0)/..
/bin/pwd
)
OUT="$ROOT/dist/"
PUBLISH_BRANCH=$1
# For this to work, the version specification must be on the second line of package.json
VERSION=$(cat "$ROOT/package.json" | sed '2!d' | egrep -o '[0-9]+\.[0-9]+\.[0-9]+')
git fetch --all
git add -f $OUT
git checkout $PUBLISH_BRANCH
git pull origin $PUBLISH_BRANCH
2019-06-27 23:45:07 +00:00
cd "v/"
# If the folder already exists we want to repalce it
if [ -d $VERSION ]; then
rm -r $VERSION
2019-06-26 03:49:20 +00:00
fi
2019-06-27 23:45:07 +00:00
# Create new version folder out of dist/
git mv -f $OUT $VERSION
2019-06-26 03:28:16 +00:00
git commit -q -m "Update the Twemoji project and push to $PUBLISH_BRANCH"
git push origin $PUBLISH_BRANCH
# Return to your working branch
2019-06-27 23:45:07 +00:00
git checkout -
cd $ROOT