Files
szci/ts/szci.classes.szcicli.ts

69 lines
1.6 KiB
TypeScript
Raw Normal View History

import { logger } from './szci.logging.ts';
import * as plugins from './szci.plugins.ts';
import * as paths from './szci.paths.ts';
import { Szci } from './szci.classes.szci.ts';
2019-08-29 20:26:23 +02:00
export class SzciCli {
public szciRef: Szci;
2019-08-29 20:26:23 +02:00
public smartcli: plugins.smartcli.Smartcli;
constructor(szciArg: Szci) {
this.szciRef = szciArg;
2019-08-29 20:26:23 +02:00
this.smartcli = new plugins.smartcli.Smartcli();
2025-12-13 13:27:51 +00:00
this.smartcli.addVersion(this.szciRef.szciInfo.version);
2019-08-29 20:26:23 +02:00
// docker
this.smartcli.addCommand('docker').subscribe(
async (argvArg) => {
await this.szciRef.dockerManager.handleCli(argvArg);
2019-08-29 20:26:23 +02:00
},
2021-05-14 18:11:12 +00:00
(err) => {
2019-08-29 20:26:23 +02:00
console.log(err);
Deno.exit(1);
2019-08-29 20:26:23 +02:00
}
);
2023-07-01 22:05:43 +02:00
// git
2019-08-29 20:26:23 +02:00
this.smartcli.addCommand('git').subscribe(
2021-05-14 18:11:12 +00:00
async (argvArg) => {
await this.szciRef.gitManager.handleCli(argvArg);
2019-08-29 20:26:23 +02:00
},
2021-05-14 18:11:12 +00:00
(err) => {
2019-08-29 20:26:23 +02:00
console.log(err);
Deno.exit(1);
2019-08-29 20:26:23 +02:00
}
);
// node
this.smartcli.addCommand('node').subscribe(
2021-05-14 18:11:12 +00:00
async (argvArg) => {
await this.szciRef.nodejsManager.handleCli(argvArg);
2019-08-29 20:26:23 +02:00
},
2021-05-14 18:11:12 +00:00
(err) => {
2019-08-29 20:26:23 +02:00
console.log(err);
Deno.exit(1);
2019-08-29 20:26:23 +02:00
}
);
// npm
this.smartcli.addCommand('npm').subscribe(
2021-05-14 18:11:12 +00:00
async (argvArg) => {
await this.szciRef.npmManager.handleCli(argvArg);
2019-08-29 20:26:23 +02:00
},
2021-05-14 18:11:12 +00:00
(err) => {
2019-08-29 20:26:23 +02:00
console.log(err);
}
);
// ssh
2023-05-07 21:30:58 +02:00
this.smartcli.addCommand('ssh').subscribe(async (argvArg) => {
2025-12-13 13:27:51 +00:00
const modSsh = await import('./mod_ssh/index.ts');
2023-05-07 21:30:58 +02:00
await modSsh.handleCli(argvArg);
});
2019-08-29 20:26:23 +02:00
}
public startParse = () => {
this.smartcli.startParse();
2019-08-29 20:38:44 +02:00
};
2019-08-29 20:26:23 +02:00
}