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

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 +16 -24
  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-2601090411") {
46998
+ return "v2.0.21-2601090411";
46999
46999
  }
47000
47000
  if (process.env.XCSH_VERSION) {
47001
47001
  return process.env.XCSH_VERSION;
@@ -75424,35 +75424,27 @@ var deleteCommand = {
75424
75424
  };
75425
75425
 
75426
75426
  // src/domains/login/profile/edit.ts
75427
- import { spawn } from "child_process";
75427
+ import { spawnSync } from "child_process";
75428
75428
  import { promises as fs3 } from "fs";
75429
75429
  import { tmpdir } from "os";
75430
75430
  import { join as join4 } from "path";
75431
75431
  function getEditor() {
75432
75432
  return process.env.EDITOR || process.env.VISUAL || "vi";
75433
75433
  }
75434
- async function openInEditor(filePath) {
75434
+ function openInEditor(filePath) {
75435
75435
  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
- });
75436
+ const result = spawnSync(editor, [filePath], {
75437
+ stdio: "inherit",
75438
+ shell: true
75455
75439
  });
75440
+ if (result.error) {
75441
+ throw new Error(
75442
+ `Failed to launch editor '${editor}': ${result.error.message}`
75443
+ );
75444
+ }
75445
+ if (result.status !== 0) {
75446
+ throw new Error(`Editor exited with code ${result.status}`);
75447
+ }
75456
75448
  }
75457
75449
  async function createTempFile(profile) {
75458
75450
  const tempDir = tmpdir();
@@ -75568,7 +75560,7 @@ Use 'login profile list' to see available profiles.`
75568
75560
  const output = [
75569
75561
  `Opening profile '${profileName}' in ${editor}...`
75570
75562
  ];
75571
- await openInEditor(tempFile);
75563
+ openInEditor(tempFile);
75572
75564
  const statsAfter = await fs3.stat(tempFile);
75573
75565
  if (statsBefore.mtimeMs === statsAfter.mtimeMs) {
75574
75566
  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-2601090411",
4
4
  "description": "F5 Distributed Cloud Shell - Interactive CLI for F5 XC",
5
5
  "type": "module",
6
6
  "bin": {