diff --git a/mash b/mash index c485384..941b639 100755 --- a/mash +++ b/mash @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env -S pkgx --quiet bash set -eo pipefail @@ -17,7 +17,7 @@ if ! command -v pkgx >/dev/null; then fi if ! command -v curl >/dev/null; then curl() { - pkgx curl "$@" + pkgx --quiet curl "$@" } fi @@ -70,7 +70,7 @@ run() { } if [ -z "$1" ]; then - curl -Ssf https://pkgxdev.github.io/mash/ | pkgx jq '.categories[]' --raw-output | sort | uniq + curl -Ssf https://pkgxdev.github.io/mash/ | pkgx --quiet jq '.categories[]' --raw-output | sort | uniq exit 0 elif [[ "$1" == *"/"* ]]; then # fully quaified name not a category @@ -79,9 +79,9 @@ elif [[ "$1" == *"/"* ]]; then run u/$cmd "$@" elif [[ -z "$2" ]]; then curl -Ssf https://pkgxdev.github.io/mash/$1/ | - pkgx jq -r '.scripts[] | [.cmd, .description] | @tsv' | + pkgx --quiet jq -r '.scripts[] | [.cmd, .description] | @tsv' | awk 'BEGIN {FS="\t"; print "| Script | Description |"; print "|-|-|"} {printf("| %s | %s |\n", $1, $2)}' | - pkgx gum format + pkgx --quiet gum format else cmd=$1/$2 shift; shift diff --git a/scripts/cache b/scripts/cache index c3e9b61..de18205 100755 --- a/scripts/cache +++ b/scripts/cache @@ -9,9 +9,9 @@ shift case "$cmd" in neophile|neophilia|neophiliac) - exec pkgx mash "pkgx/upgrade" "$@";; + exec pkgx --quiet mash "pkgx/upgrade" "$@";; ls|upgrade|prune) - exec pkgx mash "pkgx/$cmd" "$@";; + exec pkgx --quiet mash "pkgx/$cmd" "$@";; --help) usage;; *) diff --git a/scripts/demo-test-pattern b/scripts/demo-test-pattern index 32f1e92..992745d 100755 --- a/scripts/demo-test-pattern +++ b/scripts/demo-test-pattern @@ -1,4 +1,4 @@ -#!/usr/bin/env -S pkgx bash +#!/usr/bin/env -S pkgx --quiet bash printf " " for b in 0 1 2 3 4 5 6 7; do printf " 4${b}m "; done echo diff --git a/scripts/ls.rb b/scripts/ls.rb index 8257741..7d9fc21 100755 --- a/scripts/ls.rb +++ b/scripts/ls.rb @@ -1,6 +1,6 @@ #!/bin/sh -pkgx mash pkgx/ensure ruby "$0" | pkgx gum format +pkgx --quiet mash pkgx/ensure ruby "$0" | pkgx --quiet gum format exit 0 #!/usr/bin/ruby diff --git a/scripts/magic.sh b/scripts/magic.sh index fecc5f5..224117c 100755 --- a/scripts/magic.sh +++ b/scripts/magic.sh @@ -1,8 +1,8 @@ #!/bin/sh handler=$(cat </dev/null +pkgx --quiet +$1 >/dev/null +major_version=$(pkgx --version | cut -d' ' -f2 | cut -d. -f1) +minor_version=$(pkgx --version | cut -d' ' -f2 | cut -d. -f2) f=$(mktemp) -cat < "$f" -#!/bin/sh -exec pkgx $1 "\$@" -EoSH +if ! [ "$major_version" -ge 2 -a "$minor_version" -ge 4 ]; then + echo '#!/bin/sh' > "$f" + echo "exec pkgx --quiet $1 \"\$@\"" >> "$f" +elif [ $(uname) = Darwin -a "$(command -v pkgx)" = "/usr/local/bin/pkgx" ]; then + echo "#!/usr/local/bin/pkgx -q! $1" > "$f" +else + echo "#!/usr/bin/env -S pkgx -q! $1" > "$f" +fi sudo install -m 0755 "$f" /usr/local/bin/$1 diff --git a/scripts/upgrade.ts b/scripts/upgrade.ts index 8dc50a7..a314f71 100755 --- a/scripts/upgrade.ts +++ b/scripts/upgrade.ts @@ -1,4 +1,4 @@ -#!/usr/bin/env -S pkgx deno~1.39 run --ext=ts --allow-read --unstable --allow-net --allow-ffi --allow-write --allow-env --allow-run +#!/usr/bin/env -S pkgx --quiet deno~1.39 run --ext=ts --allow-read --unstable --allow-net --allow-ffi --allow-write --allow-env --allow-run import { hooks, Path, plumbing, semver, SemVer } from "https://deno.land/x/libpkgx@v0.18/mod.ts" import { walk } from "https://deno.land/std@0.214.0/fs/mod.ts"