Skip to content

Commit 97020f8

Browse files
committed
fixup! Update schema-publish.sh
1 parent d409a8e commit 97020f8

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

scripts/schema-publish.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,19 @@
77
schemaDir="src/schemas/validation"
88
branch=$(git branch --show-current)
99

10-
if [[ $branch =~ ^v([0-9]+\.[0-9]+)-dev$ ]]; then
11-
deploydir="./deploy/oas/${BASH_REMATCH[1]}"
12-
else
10+
11+
if [ -z "$1" ]; then
12+
if [[ $branch =~ ^v([0-9]+\.[0-9]+)-dev$ ]]; then
13+
deploydir="./deploy/oas/${BASH_REMATCH[1]}"
14+
else
15+
echo "Unable to determine version from branch name; should be vMAJOR.MINOR.PATCH-dev"
16+
exit 1
17+
fi
18+
elif [ $1 = "src" ]; then
1319
deploydir="./deploy-preview"
20+
else
21+
echo "Unrecognized argument"
22+
exit 1
1423
fi
1524

1625
# create the date-stamped schemas

0 commit comments

Comments
 (0)