From d4edce6559900c714b9c86a2577f2f4a2af2b059 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 26 Jun 2015 16:21:37 +0100 Subject: [PATCH] only publish babel-cli when the directory has had changes since the last version - fixes #1848 --- Makefile | 5 +---- tools/publish-cli.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100755 tools/publish-cli.sh diff --git a/Makefile b/Makefile index 92a7d1b982..8451d96f65 100644 --- a/Makefile +++ b/Makefile @@ -103,10 +103,7 @@ publish-runtime: npm publish publish-cli: - cd packages; \ - node build-cli.js; \ - cd babel-cli; \ - npm publish + @./tools/publish-cli.sh bootstrap: npm list --global --depth 1 babel >/dev/null 2>&1 && npm uninstall -g babel || true diff --git a/tools/publish-cli.sh b/tools/publish-cli.sh new file mode 100755 index 0000000000..861752c1c8 --- /dev/null +++ b/tools/publish-cli.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +LAST_TAG=$(git describe $(git rev-list --tags --max-count=1)) +TAG_DIFF=$(git diff $LAST_TAG -- packages/babel-cli/) + +if [ -n "$TAG_DIFF" ]; then + cd ../packages + node build-cli.js + + cd babel-cli + npm publish +fi