Skip to content

Commit fcb13a0

Browse files
committed
adds support for downloading gzipped binaries + parquet-tools
1 parent b2eb352 commit fcb13a0

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

bin/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ shellcheck
5050
shellspec
5151
zap-pretty
5252
act
53+
parquet-tools

bin/y-bin-dependency-download

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ bin_link=$YBIN/$bin_name
4343
[ -z "$YSTACK_BIN_DOWNLOAD_CACHE" ] || bin_cache="$YSTACK_BIN_DOWNLOAD_CACHE/$bin_uniq"
4444
[ -z "$bin_cache" ] || [ ! -f "$bin_cache" ] || url="file://$bin_cache"
4545
echo "Missing $bin_name binary. Downloading a known version from $url ..." 1>&2
46-
46+
case "$url" in
47+
*.tar.gz) ;;
48+
*.gz) bin_file=$bin_file.gz ;;
49+
esac
4750
curl -o $bin_file -L -f $url
4851
if ! echo "$sha256 $bin_file" | $SHA256SUM -c - 1>&2; then $SHA256SUM $bin_file && rm $bin_file && exit 1; fi
4952
if [ ! -z "$bin_tar_path" ]; then
@@ -57,6 +60,10 @@ bin_link=$YBIN/$bin_name
5760
(cd $tmp; unzip $bin_file)
5861
mv "$tmp/$bin_zip_path" $bin_file
5962
fi
63+
case "$url" in
64+
*.tar.gz) ;;
65+
*.gz) gunzip $bin_file && bin_file=$(echo $bin_file | sed 's/\.gz$//g') ;;
66+
esac
6067
[ -z "$bin_cache" ] || [ -f "$bin_cache" ] || cp -v $bin_file $bin_cache 1>&2
6168
chmod a+x $bin_file
6269
}

bin/y-bin.optional.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,3 +240,15 @@ deno:
240240
archive:
241241
tool: zip
242242
path: deno
243+
244+
parquet-tools:
245+
version: 1.25.4
246+
templates:
247+
download: https://github.com/hangxie/parquet-tools/releases/download/v${version}/parquet-tools-v${version}-${os}-${arch}.gz
248+
sha256:
249+
darwin_amd64: cd3b56717a5dbb6f65be5db5a16913ce3bc1c31e9268ec8f5565f97a52ce9d47
250+
darwin_arm64: 5c12d0ac8450cb2ff38f06538f4b637e75f7ee338d48b87a923b0caa999fc190
251+
linux_amd64: 0ffb333ed4ef1d190340a38e3fafcd1c1bbfa0fc6da6dba187f774219f053817
252+
linux_arm64: 3d1c792e9028464d92f98ef108dccfde1bf978687fb3cfc337bff2aac71b6bfc
253+
archive:
254+
tool: gunzip

bin/y-parquet-tools

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
[ -z "$DEBUG" ] || set -x
3+
set -e
4+
YBIN="$(dirname $0)"
5+
6+
version=$(y-bin-download $YBIN/y-bin.optional.yaml parquet-tools)
7+
8+
y-parquet-tools-v${version}-bin "$@" || exit $?

0 commit comments

Comments
 (0)