Created
October 30, 2023 13:43
-
-
Save orl0/bce9b6747eb92a386d11d51b487372cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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