Skip to content

Commit 7f9b500

Browse files
committed
chore(*): Clean update lockfile script
1 parent 5d33d9f commit 7f9b500

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

ci/commit-lockfile.sh

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,17 @@
11
#!/bin/bash
22

3-
echo `git status`
4-
echo `git diff`
5-
6-
echo "Should package-lock.json be regenerated?"
7-
# if [[ $TRAVIS_PULL_REQUEST_BRANCH != *"greenkeeper"* ]]; then
8-
# # Not a GreenKeeper Pull Request, aborting
9-
# exit 0
10-
# fi
11-
12-
echo "Cloning repo"
13-
git clone "https://"$GITHUB_TOKEN"@github.com/"$TRAVIS_REPO_SLUG".git" repo
14-
cd repo
15-
16-
echo "Switching to branch $TRAVIS_PULL_REQUEST_BRANCH"
17-
git checkout $TRAVIS_PULL_REQUEST_BRANCH
18-
19-
echo "Updating lockfile"
20-
npm i
3+
if [[ $TRAVIS_PULL_REQUEST_BRANCH != *"greenkeeper"* ]]; then
4+
# Not a GreenKeeper Pull Request, aborting
5+
exit 0
6+
fi
217

228
if ! git diff-index --quiet HEAD --; then
23-
echo "Commit and push package-lock.json"
9+
echo "Commit and push lockfile"
2410
git config --global user.email "$GITHUB_EMAIL"
2511
git config --global user.name "Travis CI"
2612
git config --global push.default simple
2713

2814
git add package-lock.json
29-
git commit -m "chore(*): update yarn.lock"
15+
git commit -m "chore(*): update lockfile"
3016
git push
3117
fi

0 commit comments

Comments
 (0)