Skip to content

Commit 97206ee

Browse files
Update script to use mint-path-resolver (#1412)
* update script to use mint-path-resolver * remove extra pushd
1 parent c1ac234 commit 97206ee

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

scripts/sync-openapi-v2.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
#!/usr/bin/env bash
22
set -eu -o pipefail
33

4-
pushd "$HOME/stripe/zoolander"
4+
zoolander_path="$(mint-path-resolver -repo zoolander)"
5+
6+
if printf '%s\n' "$zoolander_path" | grep -q 'mint'; then
7+
branch='master'
8+
else
9+
branch='master-passing-tests'
10+
fi
11+
12+
pushd "$zoolander_path"
513

614
# Pull master.
7-
echo "Bringing master-passing-tests up to date."
8-
git checkout master-passing-tests && git pull
15+
echo "Bringing $branch up to date."
16+
git checkout "$branch" && git pull
917

1018
# Grab SHA so we can save this to a file for some kind of "paper trail".
1119
SHA=$(git rev-parse HEAD)
@@ -23,8 +31,8 @@ rm -f api/openapi-spec/spec3.v2.sdk.preview.json
2331

2432
echo "$SHA" > api/ZOOLANDER_SHA
2533

26-
cp ~/stripe/zoolander/spec3.v2.sdk.json api/openapi-spec/
27-
cp ~/stripe/zoolander/spec3.v2.sdk.preview.json api/openapi-spec/
34+
cp "$(mint-path-resolver -repo zoolander)"/spec3.v2.sdk.json api/openapi-spec/
35+
cp "$(mint-path-resolver -repo zoolander)"/spec3.v2.sdk.preview.json api/openapi-spec/
2836

2937
echo "⏳ Generating resource commands..."
3038

0 commit comments

Comments
 (0)