Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: use bash to run 'gitpublish.sh' #2640

Merged
merged 1 commit into from Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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