devault-cli 0.1.1 → 0.1.2
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.js +7 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -106,7 +106,7 @@ var init_suggest = __esm(() => {
|
|
|
106
106
|
// src/cli.ts
|
|
107
107
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
108
108
|
import { homedir } from "os";
|
|
109
|
-
import { dirname, join as join2, resolve } from "path";
|
|
109
|
+
import { basename, dirname, join as join2, resolve } from "path";
|
|
110
110
|
import { spawn } from "child_process";
|
|
111
111
|
import { stdin as input, stdout as output } from "process";
|
|
112
112
|
var noPrompt = process.env.D_NO_PROMPT === "1";
|
|
@@ -241,6 +241,7 @@ async function guard(command, action) {
|
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
function run(root, command) {
|
|
244
|
+
setTerminalTitle(root, command);
|
|
244
245
|
console.log(`d: ${root} -> ${command}`);
|
|
245
246
|
return new Promise((resolveCode) => {
|
|
246
247
|
const child = spawn(command, { cwd: root, shell: true, stdio: "inherit" });
|
|
@@ -258,6 +259,11 @@ function run(root, command) {
|
|
|
258
259
|
});
|
|
259
260
|
});
|
|
260
261
|
}
|
|
262
|
+
function setTerminalTitle(root, command) {
|
|
263
|
+
if (!output.isTTY)
|
|
264
|
+
return;
|
|
265
|
+
output.write(`\x1B]0;${basename(root) || root} \u2022 ${command}\x07`);
|
|
266
|
+
}
|
|
261
267
|
main().then((code) => {
|
|
262
268
|
process.exitCode = code;
|
|
263
269
|
}).catch((error) => {
|