Skip to content

Commit

Permalink
CI: use bash to run 'gitpublish.sh' (#2640)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Jun 10, 2020
1 parent a723c29 commit 4b75720
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -45,8 +45,8 @@
"changelog": "node resources/gen-changelog.js",
"preversion": ". ./resources/checkgit.sh && npm ci",
"version": "node resources/gen-version.js && npm test && git add src/version.js",
"gitpublish:npm": ". ./resources/gitpublish.sh npm npmDist",
"gitpublish:deno": ". ./resources/gitpublish.sh deno denoDist"
"gitpublish:npm": "bash ./resources/gitpublish.sh npm npmDist",
"gitpublish:deno": "bash ./resources/gitpublish.sh deno denoDist"
},
"dependencies": {},
"devDependencies": {
Expand Down
14 changes: 12 additions & 2 deletions resources/gitpublish.sh 100644 → 100755
Expand Up @@ -13,8 +13,13 @@ DIST_DIR=$2
# Exit immediately if any subcommand terminated
set -e

if [ ! -d $DIST_DIR ]; then
echo "Directory '${DIST_DIR}' does not exist!"
if [ -z "${BRANCH}" ]; then
echo 'Must provide BRANCH as first argument!'
exit 1;
fi;

if [ -z "${DIST_DIR}" ]; then
echo 'Must provide DIST_DIR as second argument!'
exit 1;
fi;

Expand All @@ -23,6 +28,11 @@ if [ -z "${GH_TOKEN}" ]; then
exit 1;
fi;

if [ ! -d $DIST_DIR ]; then
echo "Directory '${DIST_DIR}' does not exist!"
exit 1;
fi;

# Create empty directory
rm -rf $BRANCH
git clone -b $BRANCH -- "https://${GH_TOKEN}@github.com/graphql/graphql-js.git" $BRANCH
Expand Down

0 comments on commit 4b75720

Please sign in to comment.