Skip to content

Conversation

@mxcl
Copy link
Member

@mxcl mxcl commented Apr 7, 2025

Example stub:

#!/bin/sh

dev_check() {
  [ -x /usr/local/bin/dev ] || return 1
  datadir="$HOME/Library/Application Support/pkgx/dev"
  local d="$PWD"
  until [ "$d" = "/" ]; do
    [ -f "$datadir/$d/dev.pkgx.activated" ] && return 0
    d="$(dirname "$d")"
  done
  return 1
}

if dev_check; then
  eval "$(dev --quiet)"
  [ $(command -v node 2>/dev/null) != /usr/local/bin/node ] && exec node "$@"
fi

exec /usr/local/bin/pkgx/nodejs.org/v1.2.3/bin/node "$@"

@mxcl mxcl force-pushed the dev-aware-stubs branch from a5675ff to 0604830 Compare April 7, 2025 14:30
@jhheider
Copy link
Contributor

jhheider commented Apr 7, 2025

that is highly cool.

@mxcl mxcl force-pushed the dev-aware-stubs branch 12 times, most recently from a00da2d to 4f9341b Compare April 8, 2025 17:40
@mxcl mxcl force-pushed the dev-aware-stubs branch from e6a911b to e416286 Compare April 9, 2025 13:21
@mxcl mxcl merged commit 8662db5 into main Apr 9, 2025
3 checks passed
@mxcl mxcl deleted the dev-aware-stubs branch April 9, 2025 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants