Skip to content

Instantly share code, notes, and snippets.

@JLarky
Created January 26, 2024 08:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JLarky/4317558672148b2446861f8bb56c4f03 to your computer and use it in GitHub Desktop.
Save JLarky/4317558672148b2446861f8bb56c4f03 to your computer and use it in GitHub Desktop.
Have you ever tried running TypeScript with Bash before?
curl https://gist.githubusercontent.com/JLarky/4317558672148b2446861f8bb56c4f03/raw/4f6f3cd346cdcdf176ac1ac86b1049f503f6a4e5/script.ts > script.ts
bash script.ts
#!/usr/bin/env bash
/*/.this-doesnt-exist 2>/dev/null
## Please do not edit this part of the script, this is a loader created by "bunx bun-self"
if ! [ -x "$(command -v bun)" ]; then
echo "Installing bun.sh"
sleep 2
curl -fsSL https://bun.sh/install | bash
echo "Now let's run the script"
echo ""
fi
bun $0
exit 0
#*/
// Script starts here
import { $ } from "bun";
await $`curl -s http://wttr.in`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment