Skip to content

Instantly share code, notes, and snippets.

@orl0
Created October 30, 2023 13:43
Show Gist options
  • Save orl0/bce9b6747eb92a386d11d51b487372cb to your computer and use it in GitHub Desktop.
Save orl0/bce9b6747eb92a386d11d51b487372cb to your computer and use it in GitHub Desktop.
#!/bin/sh
if command -v bun > /dev/null 2>&1; then
if [ -p /dev/stdin ]; then
stdin_fd="$(mktemp -t XXXXXXXX.bun_stdin.ts)"
command cat - >"$stdin_fd"
command exec 0<&-
command bun "$@" "$stdin_fd"
rm -f "$stdin_fd"
else
command bun "$@"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment