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