Skip to content

Latest commit

 

History

History
43 lines (26 loc) · 1.14 KB

File metadata and controls

43 lines (26 loc) · 1.14 KB

CLI Development

Maintaining code around the CLI tool

The code is in src/cli/. The CLI commands are built using steps set in package.json - see the cli command and bin section.

Run directly

$ npx ts-node src/cli/diffIndexGenerate.ts

Package as a binary

To send to someone so they can use it without having Node installed or running a build step on their machine.

$ npx --yes pkg out/cli/diffIndexGenerateCommit.js -t node18-macos

Troubleshooting

On macOS, installed here as a symlink pointing to the .js file in the repo:

/opt/homebrew/bin/acm

If you get permissions issues, it is because the .js file was rebuilt and with standard permissions and needs to be linked again.

$ npm run cli

Check:

ls -l $(realpath /opt/homebrew/bin/acm)

See package.json. Supposedly you should be able to leave out the project name when running npm link via an npm run ... command but I found this causes issues, so decided to always use the full name in the configuration. And to always unlink then link in one go because of permissions issues.