devault-cli 0.1.0 → 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/README.md CHANGED
@@ -11,7 +11,7 @@ what if all you needed to type was `d`?
11
11
  requires bun.
12
12
 
13
13
  ```sh
14
- npm i -g devault-cli
14
+ bun i -g devault-cli
15
15
  ```
16
16
 
17
17
  ## usage
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) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "devault-cli",
3
- "version": "0.1.0",
4
- "description": "A directory-aware default dev command launcher.",
3
+ "version": "0.1.2",
4
+ "description": "d the right dev command.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "d": "dist/cli.js"