diff --git a/bin/.gitignore b/bin/.gitignore index 0d938a8..1a7a2d1 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -50,3 +50,4 @@ shellcheck shellspec zap-pretty act +parquet-tools diff --git a/bin/y-bin-dependency-download b/bin/y-bin-dependency-download index f37cac1..cc34846 100755 --- a/bin/y-bin-dependency-download +++ b/bin/y-bin-dependency-download @@ -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 @@ -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 } diff --git a/bin/y-bin.optional.yaml b/bin/y-bin.optional.yaml index 6157854..2956ed9 100755 --- a/bin/y-bin.optional.yaml +++ b/bin/y-bin.optional.yaml @@ -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 diff --git a/bin/y-parquet-tools b/bin/y-parquet-tools new file mode 100755 index 0000000..eb12615 --- /dev/null +++ b/bin/y-parquet-tools @@ -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 $?