@staff0rd/assist 0.100.1 → 0.101.0
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/index.js +17 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.101.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -6734,6 +6734,15 @@ function registerRoam(program2) {
|
|
|
6734
6734
|
// src/commands/run/index.ts
|
|
6735
6735
|
import { spawn as spawn5 } from "child_process";
|
|
6736
6736
|
|
|
6737
|
+
// src/shared/formatElapsed.ts
|
|
6738
|
+
function formatElapsed(ms) {
|
|
6739
|
+
const secs = ms / 1e3;
|
|
6740
|
+
if (secs < 60) return `${secs.toFixed(1)}s`;
|
|
6741
|
+
const mins = Math.floor(secs / 60);
|
|
6742
|
+
const remainSecs = secs - mins * 60;
|
|
6743
|
+
return `${mins}m ${remainSecs.toFixed(1)}s`;
|
|
6744
|
+
}
|
|
6745
|
+
|
|
6737
6746
|
// src/commands/run/resolveParams.ts
|
|
6738
6747
|
function resolveParams(params, cliArgs) {
|
|
6739
6748
|
if (!params || params.length === 0) return cliArgs;
|
|
@@ -6869,12 +6878,18 @@ function onSpawnError(err) {
|
|
|
6869
6878
|
process.exit(1);
|
|
6870
6879
|
}
|
|
6871
6880
|
function spawnCommand2(fullCommand, env) {
|
|
6881
|
+
const start3 = Date.now();
|
|
6872
6882
|
const child = spawn5(fullCommand, [], {
|
|
6873
6883
|
stdio: "inherit",
|
|
6874
6884
|
shell: true,
|
|
6875
6885
|
env: env ? { ...process.env, ...expandEnv(env) } : void 0
|
|
6876
6886
|
});
|
|
6877
|
-
child.on("close", (code) =>
|
|
6887
|
+
child.on("close", (code) => {
|
|
6888
|
+
const elapsed = formatElapsed(Date.now() - start3);
|
|
6889
|
+
console.log(`
|
|
6890
|
+
Done in ${elapsed}`);
|
|
6891
|
+
process.exit(code ?? 0);
|
|
6892
|
+
});
|
|
6878
6893
|
child.on("error", onSpawnError);
|
|
6879
6894
|
}
|
|
6880
6895
|
function listRunConfigs() {
|