Skip to content

Commit 18e07d5

Browse files
Abort action if vscDebugger release not found
1 parent 7e60dff commit 18e07d5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

scripts/loadRPackage.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11

22

3-
3+
# Read recommended R package version from package.json
44
VERSION=$(cat package.json | jq -r .rPackageInfo.recommended)
55

66
URL=https://api.github.com/repos/ManuelHentschel/vscDebugger/releases/tags/v$VERSION
77

88
echo $URL
99

10+
# Read info about release assets from GitHub API
1011
ASSETS=$(curl $URL | jq -r .assets)
1112

13+
# Abort, if no release/assets available
14+
if [ "$ASSETS" == "null" ]; then
15+
echo "No vscDebugger release with version $VERSION found!"
16+
exit 1
17+
fi
18+
19+
# Loop over assets and download them if they are vscDebugger binaries
1220
i=0
1321
NAME=$(echo $ASSETS | jq -r .[$i].name)
1422

0 commit comments

Comments
 (0)