@uipath/rpa-tool 0.1.4 → 0.1.8

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 CHANGED
@@ -1,8 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/index.ts
4
+ import {
5
+ setOutputFormat,
6
+ telemetryFlushAndShutdown,
7
+ telemetryInit
8
+ } from "@uipath/common";
4
9
  import { Command } from "commander";
5
- import { setOutputFormat, telemetryInit, telemetryFlushAndShutdown } from "@uipath/common";
6
10
 
7
11
  // src/argv.ts
8
12
  function extractArg(argv, name, defaultValue) {
@@ -44,10 +48,10 @@ function configureHelpFormat(program) {
44
48
  const descWidth = helpWidth - ITEM_INDENT - termWidth - SPACER_WIDTH;
45
49
  const wrapped = this.boxWrap(description, Math.max(descWidth, 20));
46
50
  const indentedDesc = wrapped.replace(/\n/g, `
47
- ` + descIndent);
51
+ ${descIndent}`);
48
52
  if (this.displayWidth(term) > termWidth) {
49
- return indent + term + `
50
- ` + descIndent + indentedDesc;
53
+ return `${indent + term}
54
+ ${descIndent}${indentedDesc}`;
51
55
  }
52
56
  const paddedTerm = term.padEnd(termWidth + term.length - this.displayWidth(term));
53
57
  return indent + paddedTerm + " ".repeat(SPACER_WIDTH) + indentedDesc;
@@ -68,25 +72,36 @@ function configureHelpFormat(program) {
68
72
 
69
73
  // src/index.ts
70
74
  import { metadata, registerCommands } from "./tool.js";
75
+ if (process.platform !== "win32") {
76
+ process.env.TMPDIR = "/tmp/";
77
+ }
71
78
  var projectDir = extractArg(process.argv, "project-dir", process.cwd());
72
79
  var studioDir = extractArg(process.argv, "studio-dir");
73
80
  var timeoutRaw = extractArg(process.argv, "timeout", "300");
74
- var timeoutSeconds = parseInt(timeoutRaw, 10);
81
+ var timeoutSeconds = parseInt(timeoutRaw ?? "300", 10);
75
82
  var verbose = hasFlag(process.argv, "verbose");
76
- var useStudio = hasFlag(process.argv, "use-studio");
83
+ var useStudio = process.env.UIPATH_RPA_TOOL_USE_STUDIO === "1";
84
+ var hostStudioPid = process.env.UIPATH_STUDIO_PID ? parseInt(process.env.UIPATH_STUDIO_PID, 10) : undefined;
77
85
  var format = extractArg(process.argv, "format");
86
+ if (hasFlag(process.argv, "use-studio") && hostStudioPid) {
87
+ console.error("[rpa-tool] --use-studio is deprecated and has no effect. " + "Studio routing is automatic when UIPATH_STUDIO_PID is set.");
88
+ }
78
89
  if (format) {
79
90
  setOutputFormat(format);
80
91
  }
81
92
  var program = new Command;
82
93
  configureHelpFormat(program);
83
- program.name(metadata.name).version(metadata.version).description(metadata.description).option("--project-dir <path>", "Project directory to match against running Studio instances", process.cwd()).option("--studio-dir <path>", "Path to Studio installation directory (for starting a new instance)").option("--timeout <seconds>", "Timeout in seconds", "300").option("--verbose", "Enable verbose logging (debug level)").option("--use-studio", "Bypass Helm and interact with Studio directly").option("--format <format>", "Output format (table, json, yaml, plain)");
94
+ program.name(metadata.name).version(metadata.version).description(metadata.description).option("--project-dir <path>", "Project directory to match against running Studio instances", process.cwd()).option("--studio-dir <path>", "Path to Studio installation directory (for starting a new instance)").option("--timeout <seconds>", "Timeout in seconds", "300").option("--verbose", "Enable verbose logging (debug level)").option("--format <format>", "Output format (table, json, yaml, plain)");
95
+ if (verbose) {
96
+ console.error(`rpa-tool v${metadata.version}`);
97
+ }
84
98
  await telemetryInit({ tool: "rpa-tool", version: metadata.version });
85
99
  await registerCommands(program, {
86
- projectDir,
100
+ projectDir: projectDir ?? process.cwd(),
87
101
  studioDir,
88
102
  verbose,
89
103
  useStudio,
104
+ hostStudioPid,
90
105
  timeoutSeconds
91
106
  });
92
107
  await program.parseAsync(process.argv);