Skip to content

fix: remove python3 dependency, fix version on global install#2

Merged
nmccready merged 1 commit intomainfrom
fix/pure-bash-no-python
Mar 14, 2026
Merged

fix: remove python3 dependency, fix version on global install#2
nmccready merged 1 commit intomainfrom
fix/pure-bash-no-python

Conversation

@nmccready-tars
Copy link
Copy Markdown

Changes

1. Remove python3 dependency from cmd_sync

The sync command was shelling out to python3 to compute relative paths:

# Before (required python3)
source_rel="$(python3 -c "import os.path; print(os.path.relpath(...))" || echo "../.agents/$subdir")"

This is unnecessary — both .agents/ and .<target>/ always sit at the project root, so the relative path is always ../.agents/<subdir>. The python3 fallback was already the correct value.

# After (pure bash)
local source_rel="../$AGENTS_DIR/$subdir"

Impact: Works on any system with bash — no python3 required.

2. Fix --version on global npm install

When installed globally (npm install -g), the relative path to package.json (${SCRIPT_DIR}/../../package.json) may not resolve because npm creates a bin symlink that changes the directory structure. Version was showing unknown.

Now falls back to node -p "require('@brickhouse-tech/sync-agents/package.json').version" which uses Node's module resolution to find the package regardless of install location.

Testing

All 38 tests pass ✅ | shellcheck clean ✅

- Remove python3 os.path.relpath call from cmd_sync; use pure bash
  relative path (../.agents/<subdir>) which is always correct since
  both .agents/ and .<target>/ sit at project root
- Fix --version showing 'unknown' on global npm install by falling
  back to node require() when the relative package.json path fails
@nmccready nmccready merged commit 9171b15 into main Mar 14, 2026
6 checks passed
@nmccready nmccready deleted the fix/pure-bash-no-python branch April 8, 2026 02:44
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.

2 participants