...
1#!/bin/bash
2
3REPO_DIR=./graphql-js
4EXPORTER_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5
6cd "$EXPORTER_ROOT" || exit
7
8GIT_REF=origin/main
9
10if [[ -f "$EXPORTER_ROOT/graphql-js-commit.log" ]] ; then
11 GIT_REF=$(cat "$EXPORTER_ROOT/graphql-js-commit.log")
12fi
13echo $GIT_REF
14
15if [[ -d "$REPO_DIR" ]] ; then
16 echo "fetching graphql-js with ${GIT_REF}"
17 cd "$REPO_DIR" || exit
18 git fetch origin master
19 git checkout "$GIT_REF"
20 git reset --hard
21else
22 echo "cloning graphql-js with ${GIT_REF}"
23 git clone --no-tags --single-branch -- https://github.com/graphql/graphql-js $REPO_DIR
24 cd "$REPO_DIR" || exit
25 git checkout "$GIT_REF"
26fi
27git rev-parse HEAD > $EXPORTER_ROOT/graphql-js-commit.log
28
29cd "$EXPORTER_ROOT" || exit
30
31echo "installing js dependencies"
32npm ci
33
34echo "exporting tests"
35npx babel-node -x ".ts,.js" ./export.js
View as plain text