summaryrefslogtreecommitdiffstats
path: root/testing/get-coursier.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:05:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:05:20 +0000
commitc86df75ab11643fa4649cfe6ed5c4692d4ee342b (patch)
treede847f47ec2669e74b9a3459319579346b7c99df /testing/get-coursier.sh
parentInitial commit. (diff)
downloadpre-commit-c86df75ab11643fa4649cfe6ed5c4692d4ee342b.tar.xz
pre-commit-c86df75ab11643fa4649cfe6ed5c4692d4ee342b.zip
Adding upstream version 3.6.2.upstream/3.6.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xtesting/get-coursier.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/testing/get-coursier.sh b/testing/get-coursier.sh
new file mode 100755
index 0000000..958e73b
--- /dev/null
+++ b/testing/get-coursier.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+if [ "$OSTYPE" = msys ]; then
+ URL='https://github.com/coursier/coursier/releases/download/v2.1.0-RC4/cs-x86_64-pc-win32.zip'
+ SHA256='0d07386ff0f337e3e6264f7dde29d137dda6eaa2385f29741435e0b93ccdb49d'
+ TARGET='/tmp/coursier/cs.zip'
+
+ unpack() {
+ unzip "$TARGET" -d /tmp/coursier
+ mv /tmp/coursier/cs-*.exe /tmp/coursier/cs.exe
+ cygpath -w /tmp/coursier >> "$GITHUB_PATH"
+ }
+else
+ URL='https://github.com/coursier/coursier/releases/download/v2.1.0-RC4/cs-x86_64-pc-linux.gz'
+ SHA256='176e92e08ab292531aa0c4993dbc9f2c99dec79578752f3b9285f54f306db572'
+ TARGET=/tmp/coursier/cs.gz
+
+ unpack() {
+ gunzip "$TARGET"
+ chmod +x /tmp/coursier/cs
+ echo /tmp/coursier >> "$GITHUB_PATH"
+ }
+fi
+
+mkdir -p /tmp/coursier
+curl --location --silent --output "$TARGET" "$URL"
+echo "$SHA256 $TARGET" | sha256sum --check
+unpack