Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions mash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env -S pkgx --quiet bash

set -eo pipefail

Expand All @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions scripts/cache
Original file line number Diff line number Diff line change
Expand Up @@ -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;;
*)
Expand Down
2 changes: 1 addition & 1 deletion scripts/demo-test-pattern
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/ls.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions scripts/magic.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh

handler=$(cat <<EoHndlr
if [ -t 2 ] && [ \$1 != pkgx ] && pkgx pkgx^1 --silent --provider \$1; then
if pkgx gum confirm "^^ run that with \\\`pkgx\\\`?"; then
if [ -t 2 ] && [ \$1 != pkgx ] && pkgx --quiet pkgx^1 --silent --provider \$1; then
if pkgx --quiet gum confirm "^^ run that with \\\`pkgx\\\`?"; then
pkgx "\$@"
else
return 127
Expand Down
2 changes: 1 addition & 1 deletion scripts/pantry-inventory.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env -S pkgx deno^1.40 run --ext=ts --allow-net=dist.pkgx.dev --allow-read --allow-env --allow-ffi --unstable-ffi
#!/usr/bin/env -S pkgx --quiet deno^1.40 run --ext=ts --allow-net=dist.pkgx.dev --allow-read --allow-env --allow-ffi --unstable-ffi

import { hooks, semver } from "https://deno.land/x/libpkgx@v0.18/mod.ts"
const { usePantry, useInventory } = hooks
Expand Down
2 changes: 1 addition & 1 deletion scripts/prune.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env -S pkgx deno~1.39 run --unstable -A --ext=ts
#!/usr/bin/env -S pkgx --quiet deno~1.39 run --unstable -A --ext=ts

import { hooks, semver, SemVer, utils, plumbing, Installation } from "https://deno.land/x/libpkgx@v0.18/mod.ts"
import { Command } from "https://deno.land/x/cliffy@v1.0.0-rc.3/command/mod.ts"
Expand Down
4 changes: 2 additions & 2 deletions scripts/run
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env -S pkgx +deno bash -eo pipefail
#!/usr/bin/env -S pkgx --quiet +deno bash -eo pipefail

eval "$(pkgx --shellcode)"
eval "$(pkgx --quiet --shellcode)"

get_parameters() {
deno run --allow-read --allow-env - <<EoTS
Expand Down
16 changes: 11 additions & 5 deletions scripts/stub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,20 @@ if [ "$#" -gt 1 ]; then
exit 1
fi

pkgx +$1 >/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 <<EoSH > "$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

Expand Down
2 changes: 1 addition & 1 deletion scripts/upgrade.ts
Original file line number Diff line number Diff line change
@@ -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"
Expand Down