Skip to content

Commit

Permalink
[chore] prevent publish if an error occur.
Browse files Browse the repository at this point in the history
  • Loading branch information
diasbruno committed Jun 8, 2017
1 parent f4c8456 commit 651ce99
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ info:
@echo jq version: `$(JQ) --version` "($(JQ))"
@echo react-modal version: $(VERSION)

deps:
deps: deps-project deps-docs

deps-project:
@[[ ! -z "$(YARN)" ]] && $(YARN) install || $(NPM) install

deps-docs:
@gitbook install

# Rules for development
Expand All @@ -52,7 +56,7 @@ build:

build-docs:
@echo "[Building documentation]"
@rm -rf _book/*
@rm -rf _book
@gitbook build -g reactjs/react-modal

version:
Expand All @@ -78,12 +82,12 @@ publish-version: release-commit release-tag
npm publish
@rm .version

publish: version build publish-version publish-finished
publish: version deps-project build publish-version publish-finished

publish-docs: build-docs
publish-docs: deps-docs build-docs
@echo "[Publishing docs]"
git init _book
cd _book
git init
git commit --allow-empty -m 'update book'
git checkout -b gh-pages
touch .nojekyll
Expand Down
36 changes: 36 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/sh

NODE=`which node`
NPM=`which npm`
YARN=`which yarn`
JQ=`which jq`

echo $NODE $NPM $YARN $JQ

if [[ ! -z "$NODE" ]]; then
echo "Node is installed and it's version is: `$NODE --version`"
else
echo "Please, install node.js."
exit 1
fi

if [[ ! -z "$NPM" ]]; then
echo "NPM is installed and it's version is: `$NPM --version`"
else
echo "Please, install npm."
exit 1
fi

if [[ ! -z "$YARN" ]]; then
echo "yarn is installed and it's version is: `$YARN --version`"
else
echo "yarn is optional."
fi

if [[ ! -z "$JQ" ]]; then
echo "jq is installed and it's version is: `$JQ --version`"
else
echo "jq is optional and used only for publish purpose."
fi

npm install -g gitbook-cli
5 changes: 5 additions & 0 deletions scripts/version
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ echo "Current version is: $1"

read -p "Bump to: " NEW_VERSION

if [[ ! -z "$(git tag -l | grep v${NEW_VERSION})" ]]; then
echo "Tag $NEW_VERSION already exists."
exit 1
fi

FILES="package.json bower.json"

for F in $FILES; do
Expand Down

0 comments on commit 651ce99

Please sign in to comment.