Skip to content

Commit

Permalink
fix: global installation
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Nov 14, 2024
1 parent c9ee95f commit 913d4ac
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/dirty-parents-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hydrofoil/talos": patch
---

When installed globally, running `talos` would actually start node interpreter
13 changes: 13 additions & 0 deletions packages/cli/bin/talos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
# find JS entrypoint
talos=$(node -e "console.log(require.resolve('@hydrofoil/talos/bin/talos.js'))" 2> /dev/null)

if [ -z "$talos" ]
then
# find global talos
NODE_PATH=$(npm config get prefix)
talos=$(node -e "console.log(require('path').join('$NODE_PATH', '/lib/node_modules/@hydrofoil/talos/bin/talos.js'))")
fi

if [ -z "$talos" ]
then
echo "Could not find @hydrofoil/talos/bin/talos.js" >&2
exit 1
fi

# if ts-node exists in path
if command -v ts-node &> /dev/null
then
Expand Down

0 comments on commit 913d4ac

Please sign in to comment.