From 0412b9aae4c5a724be6eeaa500da43a2f2a5ae3a Mon Sep 17 00:00:00 2001 From: Alan Velasco Date: Wed, 26 Jun 2019 10:52:13 -0700 Subject: [PATCH] Add automatic version spec in deploy.sh --- package.json | 2 +- scripts/deploy.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0d7f8af4..f5ce8093 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "version": "yarn version", "build": "./scripts/generate", "test": "phantomjs ./src/test/testrunner.js", - "deploy": "./scripts/deploy.sh gh-pages 12.0.4", + "deploy": "./scripts/deploy.sh gh-pages", "prepublish": "run-s version build test deploy" }, "dependencies": { diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 09e438f2..d26ab787 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -6,7 +6,8 @@ ROOT=$( ) OUT="$ROOT/dist/" PUBLISH_BRANCH=$1 -VERSION=$2 +# 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