feat(cli): add update command to check and update globally installed @git.zone packages
This commit is contained in:
@@ -1,13 +1,23 @@
|
||||
import * as plugins from './tools.plugins.js';
|
||||
import * as modUpdate from './mod_update/index.js';
|
||||
|
||||
export const run = async () => {
|
||||
const toolsCli = new plugins.smartcli.Smartcli();
|
||||
|
||||
toolsCli.standardCommand().subscribe(async (argvArg) => {
|
||||
console.log('@git.zone/tools - CLI placeholder');
|
||||
console.log('No commands implemented yet.');
|
||||
console.log('@git.zone/tools - CLI utility for managing @git.zone packages\n');
|
||||
console.log('Commands:');
|
||||
console.log(' update Check and update globally installed @git.zone packages');
|
||||
console.log(' update -y Update without confirmation prompt');
|
||||
console.log('');
|
||||
console.log('Use "gtools <command> --help" for more information about a command.');
|
||||
});
|
||||
|
||||
toolsCli.addVersion('2.0.22');
|
||||
toolsCli.addCommand('update').subscribe(async (argvArg) => {
|
||||
const yesFlag = argvArg.y === true || argvArg.yes === true;
|
||||
await modUpdate.run({ yes: yesFlag });
|
||||
});
|
||||
|
||||
toolsCli.addVersion('3.0.0');
|
||||
toolsCli.startParse();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user