Skip to content

Commit 651ce99

Browse files
committed
[chore] prevent publish if an error occur.
1 parent f4c8456 commit 651ce99

File tree

3 files changed

+50
-5
lines changed

3 files changed

+50
-5
lines changed

Makefile

+9-5
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ info:
2626
@echo jq version: `$(JQ) --version` "($(JQ))"
2727
@echo react-modal version: $(VERSION)
2828

29-
deps:
29+
deps: deps-project deps-docs
30+
31+
deps-project:
3032
@[[ ! -z "$(YARN)" ]] && $(YARN) install || $(NPM) install
33+
34+
deps-docs:
3135
@gitbook install
3236

3337
# Rules for development
@@ -52,7 +56,7 @@ build:
5256

5357
build-docs:
5458
@echo "[Building documentation]"
55-
@rm -rf _book/*
59+
@rm -rf _book
5660
@gitbook build -g reactjs/react-modal
5761

5862
version:
@@ -78,12 +82,12 @@ publish-version: release-commit release-tag
7882
npm publish
7983
@rm .version
8084

81-
publish: version build publish-version publish-finished
85+
publish: version deps-project build publish-version publish-finished
8286

83-
publish-docs: build-docs
87+
publish-docs: deps-docs build-docs
8488
@echo "[Publishing docs]"
89+
git init _book
8590
cd _book
86-
git init
8791
git commit --allow-empty -m 'update book'
8892
git checkout -b gh-pages
8993
touch .nojekyll

bootstrap.sh

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/sh
2+
3+
NODE=`which node`
4+
NPM=`which npm`
5+
YARN=`which yarn`
6+
JQ=`which jq`
7+
8+
echo $NODE $NPM $YARN $JQ
9+
10+
if [[ ! -z "$NODE" ]]; then
11+
echo "Node is installed and it's version is: `$NODE --version`"
12+
else
13+
echo "Please, install node.js."
14+
exit 1
15+
fi
16+
17+
if [[ ! -z "$NPM" ]]; then
18+
echo "NPM is installed and it's version is: `$NPM --version`"
19+
else
20+
echo "Please, install npm."
21+
exit 1
22+
fi
23+
24+
if [[ ! -z "$YARN" ]]; then
25+
echo "yarn is installed and it's version is: `$YARN --version`"
26+
else
27+
echo "yarn is optional."
28+
fi
29+
30+
if [[ ! -z "$JQ" ]]; then
31+
echo "jq is installed and it's version is: `$JQ --version`"
32+
else
33+
echo "jq is optional and used only for publish purpose."
34+
fi
35+
36+
npm install -g gitbook-cli

scripts/version

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ echo "Current version is: $1"
1010

1111
read -p "Bump to: " NEW_VERSION
1212

13+
if [[ ! -z "$(git tag -l | grep v${NEW_VERSION})" ]]; then
14+
echo "Tag $NEW_VERSION already exists."
15+
exit 1
16+
fi
17+
1318
FILES="package.json bower.json"
1419

1520
for F in $FILES; do

0 commit comments

Comments
 (0)