-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add root
parameter
#41
Conversation
The `root` parameter allows specifying the root project directory. This is used to resolve the changelog file path (unless an absolute path is specified), and it's used by the `update` command to ensure the search for changes since the last release only includes changes in the given root directory. This new option is exposed via the API only on the `update` function, with the `rootProjectDirectory` option. This was the last feature required for monorepo support. Closes #34
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
console.error( | ||
`Project root must be a directory: '${projectRootDirectory}'`, | ||
); | ||
process.exit(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably out of scope for this PR, but I recently realized how strongly Node advises against the log-and-process.exit pattern: https://nodejs.org/api/process.html#process_process_exit_code
Going through snaps-cli
and getting rid of 17 cases of the same is on my TODO-list 😑
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL. Easy enough to avoid this pattern in this case at least. I can fix this in a follow-up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved here: #43
If `root` was set on the CLI, it wasn't being properly passed through to the `update` function.
Found a couple of silly mistakes in further testing - see the newest two commits. |
The
root
parameter allows specifying the root project directory. This is used to resolve the changelog file path (unless an absolute path is specified), and it's used by theupdate
command to ensure the search for changes since the last release only includes changes in the given root directory.This new option is exposed via the API only on the
update
function, with therootProjectDirectory
option.This was the last feature required for monorepo support.
Closes #34