Skip to content

Commit 0c3313c

Browse files
leebyronTravis CI
authored and
Travis CI
committed
Include bower.json
1 parent 2cd82b2 commit 0c3313c

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

resources/gitpublish.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,18 @@
88

99
# Create empty npm directory
1010
rm -rf npm
11-
mkdir npm
11+
git clone -b npm "https://${GH_TOKEN}@github.com/facebook/graphql.git" npm
12+
13+
# Remove existing files first
14+
rm -rf npm/**/*
1215

1316
# Copy over necessary files
1417
cp -r dist npm/
1518
cp -r contrib npm/
1619
cp README.md npm/
1720
cp LICENSE npm/
1821
cp PATENTS npm/
22+
cp bower.json npm/
1923

2024
# Ensure a vanilla package.json before deploying so other tools do not interpret
2125
# The built output as requiring any further transformation.
@@ -27,9 +31,13 @@ node -e "var package = require('./package.json'); \
2731
require('fs').writeFileSync('./npm/package.json', JSON.stringify(package, null, 2));"
2832

2933
cd npm
30-
git init
3134
git config user.name "Travis CI"
3235
git config user.email "github@fb.com"
33-
git add .
34-
git commit -m "Deploy master to NPM branch"
35-
git push --force --quiet "https://${GH_TOKEN}@github.com/facebook/immutable-js.git" master:npm
36+
git add -A .
37+
if git diff --staged --quiet; then
38+
echo "Nothing to publish"
39+
else
40+
git commit -a -m "Deploy master to NPM branch"
41+
git push > /dev/null 2>&1
42+
echo "Pushed"
43+
fi

0 commit comments

Comments
 (0)