2025-10-26 15:23:56 +00:00
|
|
|
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
|
|
|
|
2025-10-26 15:23:56 +00:00
|
|
|
export class SzciCli {
|
|
|
|
|
public szciRef: Szci;
|
2019-08-29 20:26:23 +02:00
|
|
|
public smartcli: plugins.smartcli.Smartcli;
|
|
|
|
|
|
2025-10-26 15:23:56 +00:00
|
|
|
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
|
|
|
|
2026-02-06 16:12:41 +00: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);
|
2025-10-26 15:23:56 +00:00
|
|
|
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) => {
|
2025-10-26 15:23:56 +00:00
|
|
|
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);
|
2025-10-26 15:23:56 +00:00
|
|
|
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) => {
|
2025-10-26 15:23:56 +00:00
|
|
|
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);
|
2025-10-26 15:23:56 +00:00
|
|
|
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) => {
|
2025-10-26 15:23:56 +00:00
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
2026-02-06 16:12:41 +00:00
|
|
|
// 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
|
|
|
}
|