svamp-cli 0.2.40 → 0.2.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs
CHANGED
|
@@ -281,7 +281,7 @@ async function main() {
|
|
|
281
281
|
console.error("svamp process: Process commands are not available in sandboxed sessions.");
|
|
282
282
|
process.exit(1);
|
|
283
283
|
}
|
|
284
|
-
const { processCommand } = await import('./commands-
|
|
284
|
+
const { processCommand } = await import('./commands-DNT-V_p6.mjs');
|
|
285
285
|
let machineId;
|
|
286
286
|
const processArgs = args.slice(1);
|
|
287
287
|
const mIdx = processArgs.findIndex((a) => a === "--machine" || a === "-m");
|
|
@@ -299,7 +299,7 @@ async function main() {
|
|
|
299
299
|
} else if (!subcommand || subcommand === "start") {
|
|
300
300
|
await handleInteractiveCommand();
|
|
301
301
|
} else if (subcommand === "--version" || subcommand === "-v") {
|
|
302
|
-
const pkg = await import('./package-
|
|
302
|
+
const pkg = await import('./package-CZ43ufBM.mjs').catch(() => ({ default: { version: "unknown" } }));
|
|
303
303
|
console.log(`svamp version: ${pkg.default.version}`);
|
|
304
304
|
} else {
|
|
305
305
|
console.error(`Unknown command: ${subcommand}`);
|
|
@@ -302,7 +302,7 @@ async function applyCommand(args, machineId) {
|
|
|
302
302
|
const spec = await readSpecFile(filePath);
|
|
303
303
|
const { server, machine } = await connectAndGetMachine(machineId);
|
|
304
304
|
try {
|
|
305
|
-
const result = await machine.processApply({ spec
|
|
305
|
+
const result = await machine.processApply({ spec });
|
|
306
306
|
const { action, info } = result;
|
|
307
307
|
if (action === "no-change") {
|
|
308
308
|
console.log(`process/${info.spec.name} unchanged`);
|
|
@@ -326,7 +326,7 @@ async function listCommand(args, machineId) {
|
|
|
326
326
|
const json = hasFlag(args, "--json");
|
|
327
327
|
const { server, machine } = await connectAndGetMachine(machineId);
|
|
328
328
|
try {
|
|
329
|
-
const processes = await machine.processList({
|
|
329
|
+
const processes = await machine.processList({});
|
|
330
330
|
if (json) {
|
|
331
331
|
console.log(JSON.stringify(processes, null, 2));
|
|
332
332
|
} else {
|
|
@@ -346,7 +346,7 @@ async function getCommand(args, machineId) {
|
|
|
346
346
|
const outFile = getFlag(args, "--save");
|
|
347
347
|
const { server, machine } = await connectAndGetMachine(machineId);
|
|
348
348
|
try {
|
|
349
|
-
const info = await machine.processGet({ idOrName
|
|
349
|
+
const info = await machine.processGet({ idOrName });
|
|
350
350
|
if (!info) {
|
|
351
351
|
console.error(`Error: process '${idOrName}' not found`);
|
|
352
352
|
process.exit(1);
|
|
@@ -386,7 +386,7 @@ async function startCommand(args, machineId) {
|
|
|
386
386
|
if (cmdArgs.length === 0) {
|
|
387
387
|
const { server: server2, machine: machine2 } = await connectAndGetMachine(machineId);
|
|
388
388
|
try {
|
|
389
|
-
await machine2.processStart({ idOrName
|
|
389
|
+
await machine2.processStart({ idOrName });
|
|
390
390
|
console.log(`Started '${idOrName}'`);
|
|
391
391
|
} finally {
|
|
392
392
|
await server2.disconnect();
|
|
@@ -443,7 +443,7 @@ async function startCommand(args, machineId) {
|
|
|
443
443
|
const saveFile = getFlag(flagArgs, "--save");
|
|
444
444
|
const { server, machine } = await connectAndGetMachine(machineId);
|
|
445
445
|
try {
|
|
446
|
-
const result = await machine.processApply({ spec
|
|
446
|
+
const result = await machine.processApply({ spec });
|
|
447
447
|
const { info } = result;
|
|
448
448
|
console.log(`Started '${info.spec.name}' (id: ${info.spec.id}, pid: ${info.state.pid ?? "\u2014"})`);
|
|
449
449
|
if (keepAlive) console.log(" Keep-alive: enabled");
|
|
@@ -465,7 +465,7 @@ async function stopCommand(args, machineId) {
|
|
|
465
465
|
}
|
|
466
466
|
const { server, machine } = await connectAndGetMachine(machineId);
|
|
467
467
|
try {
|
|
468
|
-
await machine.processStop({ idOrName
|
|
468
|
+
await machine.processStop({ idOrName });
|
|
469
469
|
console.log(`Stopped '${idOrName}'`);
|
|
470
470
|
} finally {
|
|
471
471
|
await server.disconnect();
|
|
@@ -479,7 +479,7 @@ async function restartCommand(args, machineId) {
|
|
|
479
479
|
}
|
|
480
480
|
const { server, machine } = await connectAndGetMachine(machineId);
|
|
481
481
|
try {
|
|
482
|
-
await machine.processRestart({ idOrName
|
|
482
|
+
await machine.processRestart({ idOrName });
|
|
483
483
|
console.log(`Restarted '${idOrName}'`);
|
|
484
484
|
} finally {
|
|
485
485
|
await server.disconnect();
|
|
@@ -493,7 +493,7 @@ async function deleteCommand(args, machineId) {
|
|
|
493
493
|
}
|
|
494
494
|
const { server, machine } = await connectAndGetMachine(machineId);
|
|
495
495
|
try {
|
|
496
|
-
await machine.processRemove({ idOrName
|
|
496
|
+
await machine.processRemove({ idOrName });
|
|
497
497
|
console.log(`Deleted '${idOrName}'`);
|
|
498
498
|
} finally {
|
|
499
499
|
await server.disconnect();
|
|
@@ -508,7 +508,7 @@ async function logsCommand(args, machineId) {
|
|
|
508
508
|
const last = parseIntFlag(args, "--last", 50);
|
|
509
509
|
const { server, machine } = await connectAndGetMachine(machineId);
|
|
510
510
|
try {
|
|
511
|
-
const lines = await machine.processLogs({ idOrName, last
|
|
511
|
+
const lines = await machine.processLogs({ idOrName, last });
|
|
512
512
|
if (lines.length === 0) console.log("(no output yet)");
|
|
513
513
|
else console.log(lines.join("\n"));
|
|
514
514
|
} finally {
|