@uipath/rpa-tool 0.1.4 → 0.1.6
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 +17 -7
- package/dist/tool.js +18365 -4617
- package/package.json +58 -60
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
|
-
`
|
|
51
|
+
${descIndent}`);
|
|
48
52
|
if (this.displayWidth(term) > termWidth) {
|
|
49
|
-
return indent + term
|
|
50
|
-
|
|
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,12 +72,15 @@ 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 = hasFlag(process.argv, "use-studio") || process.env.UIPATH_RPA_TOOL_USE_STUDIO === "1";
|
|
77
84
|
var format = extractArg(process.argv, "format");
|
|
78
85
|
if (format) {
|
|
79
86
|
setOutputFormat(format);
|
|
@@ -81,9 +88,12 @@ if (format) {
|
|
|
81
88
|
var program = new Command;
|
|
82
89
|
configureHelpFormat(program);
|
|
83
90
|
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)");
|
|
91
|
+
if (verbose) {
|
|
92
|
+
console.error(`rpa-tool v${metadata.version}`);
|
|
93
|
+
}
|
|
84
94
|
await telemetryInit({ tool: "rpa-tool", version: metadata.version });
|
|
85
95
|
await registerCommands(program, {
|
|
86
|
-
projectDir,
|
|
96
|
+
projectDir: projectDir ?? process.cwd(),
|
|
87
97
|
studioDir,
|
|
88
98
|
verbose,
|
|
89
99
|
useStudio,
|