Skip to content

Conversation

bhouston
Copy link
Member

@bhouston bhouston commented Mar 5, 2025

Replace shell commands with Node.js APIs for cross-platform compatibility

This PR replaces Unix/Linux-specific shell commands with Node.js native APIs for gathering system information in the agent prompt. This ensures compatibility across all operating systems, including Windows.

Changes

  • Replaced execSync('pwd') with process.cwd()
  • Replaced execSync('ls -la') with fs.readdirSync() and formatting logic
  • Replaced execSync('uname -a') with os module functions
  • Kept new Date().toString() which was already cross-platform

Testing

  • All tests pass
  • The output format is preserved to maintain compatibility with existing code
  • Added proper error handling for each function

Benefits

  • Works consistently on Windows, macOS, and Linux
  • Removes dependency on external shell commands
  • Provides more reliable system information

Fixes #98

@bhouston bhouston merged commit d40cdc8 into main Mar 5, 2025
1 check passed
Copy link

🎉 This PR is included in version mycoder-agent-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@bhouston bhouston deleted the fix/98-cross-platform-system-info branch March 12, 2025 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace shell commands with Node.js APIs for cross-platform compatibility

1 participant