-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch bin to Bash script to avoid "tsx not found" (#593)
* Switch bin/preflight.ts to bin/preflight.sh to avoid "tsx not found" * Fix path in shim * Try $script_dir path on Linux * Add debugging * Add debugging * Use base path from `pnpm bin --global` * Remove extra slashes * Comment out early exit and debugging * Delete commented debugging code * Add back debugging * Use simpler symlink path * Escape slashes
- Loading branch information
Showing
3 changed files
with
21 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
script_dir="$(cd "$(dirname "$0")" && pwd)" | ||
echo "script_dir: $script_dir" | ||
|
||
# Workaround for incorrect path in pnpm shim | ||
# https://github.com/pnpm/pnpm/issues/8704#issuecomment-2439618363 | ||
# | ||
# TODO: Remove and switch back to "$script_dir/../node_modules/.bin/tsx" | ||
# when the issue above is resolved | ||
tsx_shim="$script_dir/../node_modules/.bin/tsx" | ||
exec_command=$(awk '/^else$/{flag=1;next}/^fi$/{flag=0}flag' "$tsx_shim" | grep 'exec node') | ||
cli_path=$(echo "$exec_command" | sed -E 's/^[[:space:]]*exec node[[:space:]]+"[^"]+(node_modules\/tsx\/[^"]+)".*/\1/') | ||
cli_path="$(pnpm bin --global)/global/5/.pnpm/$cli_path" | ||
# # pnpm_bin_global="$(pnpm bin --global)/global/5/.pnpm/$cli_path" | ||
# # echo "pnpm_bin_global: $pnpm_bin_global" | ||
# cli_path="${cli_path/$pnpm_bin_global\//$pnpm_bin_global\/global\/5\/.pnpm\/}" | ||
# echo "cli_path: $cli_path" | ||
|
||
node "$cli_path" "$script_dir/../src/index.ts" |
This file was deleted.
Oops, something went wrong.
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