Skip to content

Commit 00a20fc

Browse files
Make scala-cli.sh more reliable
The .gz file we download might already be in cache (downloaded manually by users say), while the uncompressed launcher can be missing. These changes make sure we uncompress the .gz file if needed, even if it was already in cache.
1 parent 0c482f1 commit 00a20fc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scala-cli.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,14 @@ if [ ! -f "$CACHE_DEST" ]; then
2929
echo "Downloading $SCALA_CLI_URL"
3030
curl -fLo "$TMP_DEST" "$SCALA_CLI_URL"
3131
mv "$TMP_DEST" "$CACHE_DEST"
32+
fi
33+
34+
if [ ! -f "$SCALA_CLI_BIN_PATH" ]; then
3235
gunzip -k "$CACHE_DEST"
36+
fi
37+
38+
if [ ! -x "$SCALA_CLI_BIN_PATH" ]; then
3339
chmod +x "$SCALA_CLI_BIN_PATH"
3440
fi
3541

36-
exec "$SCALA_CLI_BIN_PATH" "$@"
42+
exec "$SCALA_CLI_BIN_PATH" "$@"

0 commit comments

Comments
 (0)