Closed theoludwig closed 2 years ago
The logic seems fine to me smile
LeonInstance.get(this.name)
is checking if the instance exist, I guess we don't need to make another check in the kill method (unless the config file is corrupted but it seems extremely unlikely).
Indeed, it would be better to avoid this thing in LeonInstance.kill
:
const instanceIndex = instances.findIndex((instance) => {
return instance.name === this.name
})
but we need to get the instanceIndex
to remove it in the config.
At least it does an extra check if the config is corrupted, even if it is extremely unlikely.
Do you have another solution? Or is it fine to merge this feature? :smile:
:tada: This PR is included in version 1.1.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
What changes this PR introduce?
Add the new command
leon kill
.List any relevant issue numbers
Fixes #172
Is there anything you'd like reviewers to focus on?
There are no strong automated tests for this feature. We might want to add some, but to do that, we should find out how to mock the
config
.