Skip to content

Commit

Permalink
adds support for downloading gzipped binaries + parquet-tools
Browse files Browse the repository at this point in the history
  • Loading branch information
solsson committed Dec 13, 2024
1 parent b2eb352 commit fcb13a0
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions bin/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ shellcheck
shellspec
zap-pretty
act
parquet-tools
9 changes: 8 additions & 1 deletion bin/y-bin-dependency-download
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ bin_link=$YBIN/$bin_name
[ -z "$YSTACK_BIN_DOWNLOAD_CACHE" ] || bin_cache="$YSTACK_BIN_DOWNLOAD_CACHE/$bin_uniq"
[ -z "$bin_cache" ] || [ ! -f "$bin_cache" ] || url="file://$bin_cache"
echo "Missing $bin_name binary. Downloading a known version from $url ..." 1>&2

case "$url" in
*.tar.gz) ;;
*.gz) bin_file=$bin_file.gz ;;
esac
curl -o $bin_file -L -f $url
if ! echo "$sha256 $bin_file" | $SHA256SUM -c - 1>&2; then $SHA256SUM $bin_file && rm $bin_file && exit 1; fi
if [ ! -z "$bin_tar_path" ]; then
Expand All @@ -57,6 +60,10 @@ bin_link=$YBIN/$bin_name
(cd $tmp; unzip $bin_file)
mv "$tmp/$bin_zip_path" $bin_file
fi
case "$url" in
*.tar.gz) ;;
*.gz) gunzip $bin_file && bin_file=$(echo $bin_file | sed 's/\.gz$//g') ;;
esac
[ -z "$bin_cache" ] || [ -f "$bin_cache" ] || cp -v $bin_file $bin_cache 1>&2
chmod a+x $bin_file
}
Expand Down
12 changes: 12 additions & 0 deletions bin/y-bin.optional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,15 @@ deno:
archive:
tool: zip
path: deno

parquet-tools:
version: 1.25.4
templates:
download: https://github.com/hangxie/parquet-tools/releases/download/v${version}/parquet-tools-v${version}-${os}-${arch}.gz
sha256:
darwin_amd64: cd3b56717a5dbb6f65be5db5a16913ce3bc1c31e9268ec8f5565f97a52ce9d47
darwin_arm64: 5c12d0ac8450cb2ff38f06538f4b637e75f7ee338d48b87a923b0caa999fc190
linux_amd64: 0ffb333ed4ef1d190340a38e3fafcd1c1bbfa0fc6da6dba187f774219f053817
linux_arm64: 3d1c792e9028464d92f98ef108dccfde1bf978687fb3cfc337bff2aac71b6bfc
archive:
tool: gunzip
8 changes: 8 additions & 0 deletions bin/y-parquet-tools
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
[ -z "$DEBUG" ] || set -x
set -e
YBIN="$(dirname $0)"

version=$(y-bin-download $YBIN/y-bin.optional.yaml parquet-tools)

y-parquet-tools-v${version}-bin "$@" || exit $?

0 comments on commit fcb13a0

Please sign in to comment.