Closed aarondill closed 1 year ago
Having just tested this revision on a windows OS, I can confirm that the help and version options work at the very least. It was not an extensive test, but I ran it with both options, ran it from a few different CWDs, and created a symlink and moved that around, and everything worked!
This should now be ready for review. The try-catch block has been removed, and I removed the extra call/import to fileURLToPath
. I have tested this on both Ubuntu Bash and Windows 11 command line(through node cli.js
) from many different CWDs and even through a symlink.
Reopening this PR according to @fisker's advice to merge this PR seperate to #283
:tada: This PR is included in version 2.2.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
added --version (-V) and --help (-h) options to the CLI for user interface.
--help
output:This help menu can be easily modified in cli.js. It includes the option from #281, but that could be easily removed if so desired.
--version
output:Or other such versions. The version is pulled from the project.json file in the cli script's directory. This is found by reading process.env[1], using fs.realpathSync, to read symlinks when it's installed, and path.dirname to get the parent directory. From there it is simple to read the file and call JSON.parse.