@rage-against-the-pixel/unity-cli 1.0.0

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.
@@ -0,0 +1,291 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.ResolveGlobToPath = ResolveGlobToPath;
37
+ exports.PromptForSecretInput = PromptForSecretInput;
38
+ exports.Exec = Exec;
39
+ exports.DownloadFile = DownloadFile;
40
+ exports.DeleteDirectory = DeleteDirectory;
41
+ exports.ReadFileContents = ReadFileContents;
42
+ exports.GetTempDir = GetTempDir;
43
+ exports.getArgumentValueAsString = getArgumentValueAsString;
44
+ exports.tryKillProcess = tryKillProcess;
45
+ exports.readPidFile = readPidFile;
46
+ exports.killChildProcesses = killChildProcesses;
47
+ const path = __importStar(require("path"));
48
+ const glob = __importStar(require("glob"));
49
+ const fs = __importStar(require("fs"));
50
+ const https = __importStar(require("https"));
51
+ const readline = __importStar(require("readline"));
52
+ const os = __importStar(require("os"));
53
+ const child_process_1 = require("child_process");
54
+ const logging_1 = require("./logging");
55
+ const logger = logging_1.Logger.instance;
56
+ /**
57
+ * Resolves a glob pattern to this first file path that matches it.
58
+ * @param globs An array of path segments that may include glob patterns.
59
+ * @returns The first matching file path.
60
+ */
61
+ async function ResolveGlobToPath(globs) {
62
+ const globPath = path.join(...globs).split(path.sep).join('/');
63
+ const paths = await glob.glob(globPath);
64
+ for (const path of paths) {
65
+ await fs.promises.access(path, fs.constants.R_OK);
66
+ return path;
67
+ }
68
+ throw new Error(`No accessible file found for glob pattern: ${path.normalize(globPath)}`);
69
+ }
70
+ async function PromptForSecretInput(prompt) {
71
+ return new Promise((resolve) => {
72
+ const rl = readline.createInterface({
73
+ input: process.stdin,
74
+ output: process.stdout,
75
+ terminal: true
76
+ });
77
+ rl.question(prompt, (input) => {
78
+ // mask the previous line with asterisks in place of each character
79
+ readline.moveCursor(process.stdout, 0, -1);
80
+ readline.clearLine(process.stdout, 0);
81
+ process.stdout.write(prompt + '*'.repeat(input.length) + '\n');
82
+ rl.close();
83
+ console.log(); // Don't use logger. Move to next line after input.
84
+ resolve(input);
85
+ });
86
+ });
87
+ }
88
+ /**
89
+ * Executes a command with arguments and options.
90
+ * @param command The command to execute.
91
+ * @param args The arguments for the command.
92
+ * @param options Options for the execution. `silent` controls console output, `showCommand` controls if the command is logged. If LogLevel is DEBUG, both are overridden to show command and not be silent.
93
+ * @returns The output of the command.
94
+ * @throws An error if the command returns a non-zero exit code.
95
+ */
96
+ async function Exec(command, args, options = { silent: false, showCommand: true }) {
97
+ let output = '';
98
+ let exitCode = 0;
99
+ const isDebug = logger.logLevel === logging_1.LogLevel.DEBUG;
100
+ const isSilent = isDebug ? false : options.silent ? options.silent : false;
101
+ const mustShowCommand = isDebug ? true : options.showCommand ? options.showCommand : false;
102
+ function processOutput(data) {
103
+ const chunk = data.toString();
104
+ output += chunk;
105
+ if (!isSilent) {
106
+ process.stdout.write(chunk);
107
+ }
108
+ }
109
+ if (mustShowCommand) {
110
+ const commandStr = `\x1b[34m${command} ${args.join(' ')}\x1b[0m`;
111
+ if (isSilent) {
112
+ logger.info(commandStr);
113
+ }
114
+ else {
115
+ logger.startGroup(commandStr);
116
+ }
117
+ }
118
+ if (command.includes(path.sep)) {
119
+ fs.accessSync(command, fs.constants.R_OK | fs.constants.X_OK);
120
+ }
121
+ try {
122
+ exitCode = await new Promise((resolve, reject) => {
123
+ const child = (0, child_process_1.spawn)(command, args, {
124
+ env: process.env,
125
+ stdio: ['ignore', 'pipe', 'pipe'],
126
+ });
127
+ process.once('SIGINT', () => child.kill('SIGINT'));
128
+ process.once('SIGTERM', () => child.kill('SIGTERM'));
129
+ child.stdout.on('data', processOutput);
130
+ child.stderr.on('data', processOutput);
131
+ child.on('error', (error) => reject(error));
132
+ child.on('close', (code) => {
133
+ process.stdout.write('\n');
134
+ resolve(code === null ? 0 : code);
135
+ });
136
+ });
137
+ }
138
+ finally {
139
+ if (mustShowCommand) {
140
+ if (!isSilent) {
141
+ logger.endGroup();
142
+ }
143
+ }
144
+ if (exitCode !== 0) {
145
+ throw new Error(`${command} failed with exit code ${exitCode}`);
146
+ }
147
+ }
148
+ return output;
149
+ }
150
+ async function DownloadFile(url, downloadPath) {
151
+ logger.debug(`Downloading from ${url} to ${downloadPath}...`);
152
+ await fs.promises.mkdir(path.dirname(downloadPath), { recursive: true });
153
+ await new Promise((resolve, reject) => {
154
+ const file = fs.createWriteStream(downloadPath, { mode: 0o755 });
155
+ https.get(url, (response) => {
156
+ response.pipe(file);
157
+ file.on('finish', () => {
158
+ file.close();
159
+ resolve();
160
+ });
161
+ }).on('error', (error) => {
162
+ fs.unlink(downloadPath, () => reject(`Download failed: ${error}`));
163
+ });
164
+ });
165
+ // make sure the file is closed and accessible
166
+ await new Promise((r) => setTimeout(r, 100));
167
+ await fs.promises.access(downloadPath, fs.constants.R_OK | fs.constants.X_OK);
168
+ }
169
+ async function DeleteDirectory(targetPath) {
170
+ logger.debug(`Attempting to delete directory: ${targetPath}...`);
171
+ if (targetPath && targetPath.length > 0 && fs.existsSync(targetPath)) {
172
+ await fs.promises.rm(targetPath, { recursive: true, force: true, maxRetries: 2, retryDelay: 100 });
173
+ }
174
+ }
175
+ async function ReadFileContents(filePath) {
176
+ const fileHandle = await fs.promises.open(filePath, 'r');
177
+ try {
178
+ const projectSettingsContent = await fileHandle.readFile('utf8');
179
+ return projectSettingsContent;
180
+ }
181
+ finally {
182
+ await fileHandle.close();
183
+ }
184
+ }
185
+ function GetTempDir() {
186
+ if (process.env['RUNNER_TEMP']) {
187
+ return process.env['RUNNER_TEMP'];
188
+ }
189
+ else if (process.env['TMPDIR']) {
190
+ return process.env['TMPDIR'];
191
+ }
192
+ else if (process.env['TEMP']) {
193
+ return process.env['TEMP'];
194
+ }
195
+ else if (process.env['TMP']) {
196
+ return process.env['TMP'];
197
+ }
198
+ // fallback to current directory
199
+ return os.tmpdir();
200
+ }
201
+ /**
202
+ * Get the value of a command line argument.
203
+ * @param value The name of the argument to retrieve.
204
+ * @param args The list of command line arguments.
205
+ * @returns The value of the argument or an error if not found.
206
+ */
207
+ function getArgumentValueAsString(value, args) {
208
+ const index = args.indexOf(value);
209
+ if (index === -1 || index === args.length - 1) {
210
+ throw Error(`Missing ${value} argument`);
211
+ }
212
+ return args[index + 1];
213
+ }
214
+ /**
215
+ * Attempts to kill a process with the given ProcInfo.
216
+ * @param procInfo The process information containing the PID.
217
+ * @returns The PID of the killed process, or undefined if no process was killed.
218
+ */
219
+ async function tryKillProcess(procInfo) {
220
+ let pid;
221
+ try {
222
+ pid = procInfo.pid;
223
+ logger.ci(`Killing process '${procInfo.name}' with pid: ${pid}`);
224
+ process.kill(pid);
225
+ }
226
+ catch (error) {
227
+ const nodeJsException = error;
228
+ const errorCode = nodeJsException?.code;
229
+ if (errorCode !== 'ENOENT' && errorCode !== 'ESRCH') {
230
+ logger.error(`Failed to kill process:\n${JSON.stringify(error)}`);
231
+ }
232
+ }
233
+ return pid;
234
+ }
235
+ async function readPidFile(pidFilePath) {
236
+ let procInfo;
237
+ try {
238
+ if (!fs.existsSync(pidFilePath)) {
239
+ logger.debug(`PID file does not exist: ${pidFilePath}`);
240
+ return procInfo;
241
+ }
242
+ const fileHandle = await fs.promises.open(pidFilePath, 'r');
243
+ try {
244
+ const pid = parseInt(await fileHandle.readFile('utf8'));
245
+ if (isNaN(pid)) {
246
+ logger.error(`Invalid PID in file: ${pidFilePath}`);
247
+ return procInfo;
248
+ }
249
+ procInfo = { pid, ppid: 0, name: '' };
250
+ }
251
+ catch (error) {
252
+ logger.error(`Failed to read PID file: ${pidFilePath}\n${error}`);
253
+ }
254
+ finally {
255
+ await fileHandle.close();
256
+ await fs.promises.unlink(pidFilePath);
257
+ }
258
+ }
259
+ catch (error) {
260
+ // ignored
261
+ }
262
+ return procInfo;
263
+ }
264
+ async function killChildProcesses(procInfo) {
265
+ logger.debug(`Killing child processes of ${procInfo.name} with pid: ${procInfo.pid}...`);
266
+ try {
267
+ if (process.platform === 'win32') {
268
+ const pwshCommand = 'powershell -Command "Get-CimInstance Win32_Process -Filter \'ParentProcessId=' + procInfo.pid + '\' | ForEach-Object { Stop-Process -Id $_.ProcessId -Force }"';
269
+ await Exec('cmd', ['/c', pwshCommand], { silent: true });
270
+ }
271
+ else { // linux and macos
272
+ const psOutput = await Exec('ps', ['-eo', 'pid,ppid,comm'], { silent: true });
273
+ const lines = psOutput.split('\n').slice(1); // Skip header line
274
+ for (const line of lines) {
275
+ const parts = line.trim().split(/\s+/, 3);
276
+ if (parts.length === 3) {
277
+ const pid = parseInt(parts[0], 10);
278
+ const ppid = parseInt(parts[1], 10);
279
+ const name = parts[2];
280
+ if (ppid === procInfo.pid) {
281
+ await tryKillProcess({ pid, ppid, name });
282
+ }
283
+ }
284
+ }
285
+ }
286
+ }
287
+ catch (error) {
288
+ logger.error(`Failed to kill child processes of pid ${procInfo.pid}:\n${JSON.stringify(error)}`);
289
+ }
290
+ }
291
+ //# sourceMappingURL=utilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utilities.js","sourceRoot":"","sources":["../src/utilities.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,8CAUC;AAED,oDAkBC;AAeD,oBA4DC;AAED,oCAkBC;AAED,0CAKC;AAED,4CAQC;AAED,gCAYC;AAQD,4DAQC;AAaD,wCAiBC;AAED,kCA6BC;AAED,gDA0BC;AArRD,2CAA6B;AAC7B,2CAA6B;AAC7B,uCAAyB;AACzB,6CAA+B;AAC/B,mDAAqC;AACrC,uCAAyB;AACzB,iDAAsC;AACtC,uCAA6C;AAE7C,MAAM,MAAM,GAAG,gBAAM,CAAC,QAAQ,CAAC;AAE/B;;;;GAIG;AACI,KAAK,UAAU,iBAAiB,CAAC,KAAe;IACnD,MAAM,QAAQ,GAAW,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvE,MAAM,KAAK,GAAa,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAElD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,MAAM,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAClD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,8CAA8C,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC9F,CAAC;AAEM,K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,IAAI,EAAE,CAAC,CAAC;YAC9E,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,mBAAmB;YAEhE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACvB,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;gBAC1C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBACrB,MAAM,GAAG,GAAW,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAE,EAAE,EAAE,CAAC,CAAC;oBAC5C,MAAM,IAAI,GAAW,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAE,EAAE,EAAE,CAAC,CAAC;oBAC7C,MAAM,IAAI,GAAW,KAAK,CAAC,CAAC,CAAE,CAAC;oBAE/B,IAAI,IAAI,KAAK,QAAQ,CAAC,GAAG,EAAE,CAAC;wBACxB,MAAM,cAAc,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC9C,CAAC;gBACL,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,MAAM,CAAC,KAAK,CAAC,yCAAyC,QAAQ,CAAC,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACrG,CAAC;AACL,CAAC"}
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@rage-against-the-pixel/unity-cli",
3
+ "version": "1.0.0",
4
+ "description": "A command line utility for the Unity Game Engine.",
5
+ "author": "RageAgainstThePixel",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/RageAgainstThePixel/unity-cli.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/RageAgainstThePixel/unity-cli/issues"
13
+ },
14
+ "homepage": "https://github.com/RageAgainstThePixel/unity-cli#readme",
15
+ "main": "dist/index.js",
16
+ "bin": {
17
+ "unity-cli": "./dist/index.js"
18
+ },
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "scripts": {
23
+ "build": "tsc",
24
+ "dev": "tsc --watch",
25
+ "link": "npm link",
26
+ "tests": "jest --roots tests"
27
+ },
28
+ "dependencies": {
29
+ "@electron/asar": "^4.0.1",
30
+ "@rage-against-the-pixel/unity-releases-api": "^1.0.2",
31
+ "commander": "^14.0.1",
32
+ "glob": "^11.0.3",
33
+ "semver": "^7.7.2",
34
+ "source-map-support": "^0.5.21",
35
+ "yaml": "^2.8.1"
36
+ },
37
+ "devDependencies": {
38
+ "@types/commander": "^2.12.0",
39
+ "@types/jest": "^30.0.0",
40
+ "@types/node": "^24.5.2",
41
+ "@types/semver": "^7.7.1",
42
+ "jest": "^30.1.3",
43
+ "ts-jest": "^29.4.4",
44
+ "ts-node": "^10.9.2",
45
+ "typescript": "^5.9.2"
46
+ }
47
+ }