1
0

dsh 814 B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. # dsh launcher: runs the apps/cli `dsh` bin FROM SOURCE through Node's native
  3. # TypeScript transform, so a symlink from anywhere (e.g. ~/.local/bin/dsh)
  4. # always executes the current working tree without a build step.
  5. set -eu
  6. # Resolve symlink chains without readlink -f (not on every macOS).
  7. script=$0
  8. while [ -L "$script" ]; do
  9. target=$(readlink "$script")
  10. case $target in
  11. /*) script=$target ;;
  12. *) script=$(dirname "$script")/$target ;;
  13. esac
  14. done
  15. root=$(CDPATH='' cd -- "$(dirname -- "$script")/.." && pwd)
  16. # The preloader projects this checkout's tsconfig paths into Node resolution;
  17. # TypeScript transformation itself remains Node-owned (no tsx/esbuild hook).
  18. exec node --experimental-transform-types \
  19. --import "$root/scripts/tspath-loader.ts" \
  20. "$root/apps/cli/src/bin.ts" "$@"