@robinmordasiewicz/f5xc-xcsh 2.0.21-2601090340 → 2.0.21-2601090431

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.
Files changed (2) hide show
  1. package/dist/index.js +30 -26
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -46994,8 +46994,8 @@ function getLogoModeFromEnv(envPrefix) {
46994
46994
  var CLI_NAME = "xcsh";
46995
46995
  var CLI_FULL_NAME = "F5 Distributed Cloud Shell";
46996
46996
  function getVersion() {
46997
- if ("v2.0.21-2601090340") {
46998
- return "v2.0.21-2601090340";
46997
+ if ("v2.0.21-2601090431") {
46998
+ return "v2.0.21-2601090431";
46999
46999
  }
47000
47000
  if (process.env.XCSH_VERSION) {
47001
47001
  return process.env.XCSH_VERSION;
@@ -74223,8 +74223,9 @@ function InputBox({
74223
74223
  }
74224
74224
 
74225
74225
  // src/repl/components/StatusBar.tsx
74226
- import { execSync } from "child_process";
74227
74226
  var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
74227
+ import { execSync } from "child_process";
74228
+ import { homedir as homedir3 } from "os";
74228
74229
  function getStatusIcon(gitInfo) {
74229
74230
  if (gitInfo.ahead > 0 && gitInfo.behind > 0) {
74230
74231
  return "\u21C5";
@@ -74249,6 +74250,17 @@ function getStatusColor(gitInfo) {
74249
74250
  }
74250
74251
  return "#00c853";
74251
74252
  }
74253
+ function getFormattedCwd() {
74254
+ const cwd2 = process.cwd();
74255
+ const home = homedir3();
74256
+ if (cwd2 === home) {
74257
+ return "~";
74258
+ }
74259
+ if (cwd2.startsWith(home + "/")) {
74260
+ return "~" + cwd2.slice(home.length);
74261
+ }
74262
+ return cwd2;
74263
+ }
74252
74264
  function StatusBar({
74253
74265
  gitInfo,
74254
74266
  width = 80,
@@ -74266,7 +74278,7 @@ function StatusBar({
74266
74278
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color, children: icon })
74267
74279
  ] });
74268
74280
  }
74269
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: "#ffffff", children: CLI_NAME });
74281
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: "#666666", children: getFormattedCwd() });
74270
74282
  };
74271
74283
  const renderRight = () => {
74272
74284
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: "#666666", children: hint });
@@ -75424,35 +75436,27 @@ var deleteCommand = {
75424
75436
  };
75425
75437
 
75426
75438
  // src/domains/login/profile/edit.ts
75427
- import { spawn } from "child_process";
75439
+ import { spawnSync } from "child_process";
75428
75440
  import { promises as fs3 } from "fs";
75429
75441
  import { tmpdir } from "os";
75430
75442
  import { join as join4 } from "path";
75431
75443
  function getEditor() {
75432
75444
  return process.env.EDITOR || process.env.VISUAL || "vi";
75433
75445
  }
75434
- async function openInEditor(filePath) {
75446
+ function openInEditor(filePath) {
75435
75447
  const editor = getEditor();
75436
- return new Promise((resolve, reject) => {
75437
- const child = spawn(editor, [filePath], {
75438
- stdio: "inherit",
75439
- shell: true
75440
- });
75441
- child.on("error", (error) => {
75442
- reject(
75443
- new Error(
75444
- `Failed to launch editor '${editor}': ${error.message}`
75445
- )
75446
- );
75447
- });
75448
- child.on("exit", (code) => {
75449
- if (code === 0) {
75450
- resolve();
75451
- } else {
75452
- reject(new Error(`Editor exited with code ${code}`));
75453
- }
75454
- });
75448
+ const result = spawnSync(editor, [filePath], {
75449
+ stdio: "inherit",
75450
+ shell: true
75455
75451
  });
75452
+ if (result.error) {
75453
+ throw new Error(
75454
+ `Failed to launch editor '${editor}': ${result.error.message}`
75455
+ );
75456
+ }
75457
+ if (result.status !== 0) {
75458
+ throw new Error(`Editor exited with code ${result.status}`);
75459
+ }
75456
75460
  }
75457
75461
  async function createTempFile(profile) {
75458
75462
  const tempDir = tmpdir();
@@ -75568,7 +75572,7 @@ Use 'login profile list' to see available profiles.`
75568
75572
  const output = [
75569
75573
  `Opening profile '${profileName}' in ${editor}...`
75570
75574
  ];
75571
- await openInEditor(tempFile);
75575
+ openInEditor(tempFile);
75572
75576
  const statsAfter = await fs3.stat(tempFile);
75573
75577
  if (statsBefore.mtimeMs === statsAfter.mtimeMs) {
75574
75578
  output.push("", "No changes made.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robinmordasiewicz/f5xc-xcsh",
3
- "version": "2.0.21-2601090340",
3
+ "version": "2.0.21-2601090431",
4
4
  "description": "F5 Distributed Cloud Shell - Interactive CLI for F5 XC",
5
5
  "type": "module",
6
6
  "bin": {