diff --git a/CHANGELOG.md b/CHANGELOG.md index d64ec42..834d21c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog]. ## Unreleased ### Enhancements +* `apheleia-npx` updated to handle bun projects ([#292]) ### Formatters ### Bugs fixed * `apheleia-indent-lisp-buffer` updated to apply local variables after diff --git a/scripts/formatters/apheleia-npx b/scripts/formatters/apheleia-npx index 8f6a366..c08dce7 100755 --- a/scripts/formatters/apheleia-npx +++ b/scripts/formatters/apheleia-npx @@ -40,6 +40,7 @@ if [[ -d $dir ]]; then pnp_root=$(find_upwards '.pnp.cjs') npm_root=$(find_upwards 'node_modules') + bun_root=$(find_upwards 'bun.lockb') if [[ -n ${pnp_root} && ${#pnp_root} -gt ${#npm_root} ]]; then # trying pnp @@ -55,6 +56,11 @@ if [[ -d $dir ]]; then command="${node} --require ${pnp_path} ${loader_opt} ${bin} ${@:2}" exec ${command} fi + + elif [[ -n ${bun_root} ]]; then + bun=$(which bun) + exec "$bun" "$@" + elif [[ -n ${npm_root} ]]; then # trying npm node_modules_paths=(\