feat(storage): add "end" method to storage for cleaning up resources when commands are finished

This commit is contained in:
Joakim Carlstein 2023-12-08 13:01:19 +01:00
parent 334e2099bb
commit 703e6f028a
15 changed files with 150 additions and 77 deletions

View file

@ -230,7 +230,7 @@ Examples:
try {
const { default: listCommand } = await import('./commands/list.js');
await listCommand({ directory, storage, reporter });
process.exitCode = await listCommand({ directory, storage, reporter });
} catch (error) {
if (error instanceof ShowUsageError) {
console.error(error.message, '\n');
@ -306,7 +306,7 @@ Examples:
try {
const { default: removeCommand } = await import('./commands/remove.js');
await removeCommand({ directory, storage, reporter, force }, positionals[0] ?? '');
process.exitCode = await removeCommand({ directory, storage, reporter, force }, positionals[0] ?? '');
} catch (error) {
if (error instanceof ShowUsageError) {
console.error(error.message, '\n');