@notask/unity-cli-tools 1.0.6-rc.1 → 1.0.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/CHANGELOG.md +16 -0
- package/dist/cjs/unityEditor.js +25 -11
- package/dist/cjs/unityHub.js +7 -4
- package/dist/esm/unityEditor.d.ts +1 -1
- package/dist/esm/unityEditor.js +25 -11
- package/dist/esm/unityHub.js +7 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## [1.0.6](https://github.com/NoTaskStudios/unity-cli-tools/compare/1.0.5...1.0.6) (2025-04-30)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **Hub:** adjust in default params values ([ca12050](https://github.com/NoTaskStudios/unity-cli-tools/commit/ca120505433e4c6c01c54e1917de564a4883416b))
|
|
7
|
+
* **Hub:** auto detect system arch when arg no passed ([1e6ff27](https://github.com/NoTaskStudios/unity-cli-tools/commit/1e6ff27ca37a70014823693489447d8cd2ada9b9))
|
|
8
|
+
* **Hub:** Remove some class members ([78c37e2](https://github.com/NoTaskStudios/unity-cli-tools/commit/78c37e2b83197e6d8445bbdeeb23ff4c457eedd0))
|
|
9
|
+
|
|
10
|
+
## [1.0.6-rc.2](https://github.com/NoTaskStudios/unity-cli-tools/compare/1.0.6-rc.1...1.0.6-rc.2) (2025-04-30)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **Hub:** auto detect system arch when arg no passed ([1e6ff27](https://github.com/NoTaskStudios/unity-cli-tools/commit/1e6ff27ca37a70014823693489447d8cd2ada9b9))
|
|
16
|
+
|
|
1
17
|
## [1.0.6-rc.1](https://github.com/NoTaskStudios/unity-cli-tools/compare/1.0.5...1.0.6-rc.1) (2025-04-30)
|
|
2
18
|
|
|
3
19
|
|
package/dist/cjs/unityEditor.js
CHANGED
|
@@ -74,13 +74,28 @@ class UnityEditor {
|
|
|
74
74
|
const { stdout, stderr } = await this.execUnityEditorCommand({ version: projectInfo.editorVersion, path: unityPath }, editorArgs, options);
|
|
75
75
|
if (stderr) {
|
|
76
76
|
console.error(`Error executing method: ${stderr}`);
|
|
77
|
-
return
|
|
77
|
+
return {
|
|
78
|
+
success: false,
|
|
79
|
+
stdout: "",
|
|
80
|
+
stderr: stderr,
|
|
81
|
+
exitCode: -1,
|
|
82
|
+
};
|
|
78
83
|
}
|
|
79
|
-
return
|
|
84
|
+
return {
|
|
85
|
+
success: true,
|
|
86
|
+
stdout: stdout,
|
|
87
|
+
stderr: "",
|
|
88
|
+
exitCode: 0,
|
|
89
|
+
};
|
|
80
90
|
}
|
|
81
91
|
catch (error) {
|
|
82
92
|
console.error("Error executing method:", error);
|
|
83
|
-
return
|
|
93
|
+
return {
|
|
94
|
+
success: false,
|
|
95
|
+
stdout: "",
|
|
96
|
+
stderr: String(error),
|
|
97
|
+
exitCode: -1,
|
|
98
|
+
};
|
|
84
99
|
}
|
|
85
100
|
}
|
|
86
101
|
static async runTests(projectInfo, testPlatform = unity_js_1.TestMode.EditMode, testCategory) {
|
|
@@ -129,7 +144,7 @@ class UnityEditor {
|
|
|
129
144
|
const activationSuccessful = stdout.includes("successfully activated") ||
|
|
130
145
|
(!stdout.includes("License activation failed") && !stderr.includes("License activation failed"));
|
|
131
146
|
if (activationSuccessful) {
|
|
132
|
-
console.
|
|
147
|
+
console.debug(`Successfully activated license for Unity ${projectInfo.editorVersion}`);
|
|
133
148
|
return true;
|
|
134
149
|
}
|
|
135
150
|
else {
|
|
@@ -153,7 +168,7 @@ class UnityEditor {
|
|
|
153
168
|
const returnSuccessful = stdout.includes("license return succeeded") ||
|
|
154
169
|
(!stdout.includes("Failed to return license") && !stderr.includes("Failed to return license"));
|
|
155
170
|
if (returnSuccessful) {
|
|
156
|
-
console.
|
|
171
|
+
console.debug(`Successfully returned license for Unity ${projectInfo.editorVersion}`);
|
|
157
172
|
return true;
|
|
158
173
|
}
|
|
159
174
|
else {
|
|
@@ -176,7 +191,7 @@ class UnityEditor {
|
|
|
176
191
|
});
|
|
177
192
|
const exportSuccessful = !stdout.includes("Failed to export package") && !stderr.includes("Failed to export package");
|
|
178
193
|
if (exportSuccessful) {
|
|
179
|
-
console.
|
|
194
|
+
console.debug(`Successfully exported package to ${outputPath}`);
|
|
180
195
|
return true;
|
|
181
196
|
}
|
|
182
197
|
else {
|
|
@@ -199,7 +214,7 @@ class UnityEditor {
|
|
|
199
214
|
});
|
|
200
215
|
const importSuccessful = !stdout.includes("Failed to import package") && !stderr.includes("Failed to import package");
|
|
201
216
|
if (importSuccessful) {
|
|
202
|
-
console.
|
|
217
|
+
console.debug(`Successfully imported package ${packagePath}`);
|
|
203
218
|
return true;
|
|
204
219
|
}
|
|
205
220
|
else {
|
|
@@ -227,7 +242,7 @@ class UnityEditor {
|
|
|
227
242
|
});
|
|
228
243
|
const creationSuccessful = !stdout.includes("Failed to create project") && !stderr.includes("Failed to create project");
|
|
229
244
|
if (creationSuccessful) {
|
|
230
|
-
console.
|
|
245
|
+
console.debug(`Successfully created project at ${projectInfo.projectPath}`);
|
|
231
246
|
return true;
|
|
232
247
|
}
|
|
233
248
|
else {
|
|
@@ -258,13 +273,12 @@ class UnityEditor {
|
|
|
258
273
|
const { stdout, stderr } = await this.execUnityEditorCommand(editorInfo, args, options);
|
|
259
274
|
const openingSuccessful = !stdout.includes("Failed to open project") && !stderr.includes("Failed to open project");
|
|
260
275
|
if (openingSuccessful) {
|
|
261
|
-
console.
|
|
262
|
-
return true;
|
|
276
|
+
console.debug(`Successfully opened project`);
|
|
263
277
|
}
|
|
264
278
|
else {
|
|
265
279
|
console.error(`Failed to open project: ${stderr || stdout}`);
|
|
266
|
-
return false;
|
|
267
280
|
}
|
|
281
|
+
return openingSuccessful;
|
|
268
282
|
}
|
|
269
283
|
catch (error) {
|
|
270
284
|
console.error("Error opening project:", error);
|
package/dist/cjs/unityHub.js
CHANGED
|
@@ -44,7 +44,7 @@ class UnityHub {
|
|
|
44
44
|
}
|
|
45
45
|
static async isUnityHubAvailable() {
|
|
46
46
|
try {
|
|
47
|
-
return
|
|
47
|
+
return !!this.hubPath && fs_extra_1.default.existsSync(this.hubPath);
|
|
48
48
|
}
|
|
49
49
|
catch (error) {
|
|
50
50
|
console.error("Error checking Unity Hub availability:", error);
|
|
@@ -143,7 +143,7 @@ class UnityHub {
|
|
|
143
143
|
throw error;
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
static async addEditor(version, modules = [], architecture
|
|
146
|
+
static async addEditor(version, modules = [], architecture) {
|
|
147
147
|
try {
|
|
148
148
|
const data = await (0, unity_changeset_1.getUnityChangeset)(version);
|
|
149
149
|
const args = ["install", "-v", version];
|
|
@@ -152,9 +152,12 @@ class UnityHub {
|
|
|
152
152
|
args.push("--module");
|
|
153
153
|
args.push(modules.join(" "));
|
|
154
154
|
}
|
|
155
|
-
if (
|
|
156
|
-
|
|
155
|
+
if (!architecture) {
|
|
156
|
+
const arch = os_1.default.arch() || process.arch;
|
|
157
|
+
const defaultArchitecture = arch === "arm64" || arch === "arm" ? unity_js_1.EditorArchitecture.arm64 : unity_js_1.EditorArchitecture.x86_64;
|
|
158
|
+
architecture = defaultArchitecture;
|
|
157
159
|
}
|
|
160
|
+
args.push("--architecture", architecture);
|
|
158
161
|
const { stdout, stderr } = await this.execUnityHubCommand(args, {
|
|
159
162
|
reject: false,
|
|
160
163
|
});
|
|
@@ -4,7 +4,7 @@ declare class UnityEditor {
|
|
|
4
4
|
static getUnityExecutablePath(version: string): string;
|
|
5
5
|
static isUnityVersionInstalled(version: string): Promise<boolean>;
|
|
6
6
|
static execUnityEditorCommand(editorInfo: UnityEditorInfo, args: string[], options?: CommandOptions): Promise<CommandResult>;
|
|
7
|
-
static executeMethod(projectInfo: ProjectInfo, method: string, args?: string[], options?: CommandOptions): Promise<
|
|
7
|
+
static executeMethod(projectInfo: ProjectInfo, method: string, args?: string[], options?: CommandOptions): Promise<CommandResult>;
|
|
8
8
|
static runTests(projectInfo: ProjectInfo, testPlatform?: TestMode | UnityBuildTarget, testCategory?: string): Promise<{
|
|
9
9
|
success: boolean;
|
|
10
10
|
output: string;
|
package/dist/esm/unityEditor.js
CHANGED
|
@@ -69,13 +69,28 @@ class UnityEditor {
|
|
|
69
69
|
const { stdout, stderr } = await this.execUnityEditorCommand({ version: projectInfo.editorVersion, path: unityPath }, editorArgs, options);
|
|
70
70
|
if (stderr) {
|
|
71
71
|
console.error(`Error executing method: ${stderr}`);
|
|
72
|
-
return
|
|
72
|
+
return {
|
|
73
|
+
success: false,
|
|
74
|
+
stdout: "",
|
|
75
|
+
stderr: stderr,
|
|
76
|
+
exitCode: -1,
|
|
77
|
+
};
|
|
73
78
|
}
|
|
74
|
-
return
|
|
79
|
+
return {
|
|
80
|
+
success: true,
|
|
81
|
+
stdout: stdout,
|
|
82
|
+
stderr: "",
|
|
83
|
+
exitCode: 0,
|
|
84
|
+
};
|
|
75
85
|
}
|
|
76
86
|
catch (error) {
|
|
77
87
|
console.error("Error executing method:", error);
|
|
78
|
-
return
|
|
88
|
+
return {
|
|
89
|
+
success: false,
|
|
90
|
+
stdout: "",
|
|
91
|
+
stderr: String(error),
|
|
92
|
+
exitCode: -1,
|
|
93
|
+
};
|
|
79
94
|
}
|
|
80
95
|
}
|
|
81
96
|
static async runTests(projectInfo, testPlatform = TestMode.EditMode, testCategory) {
|
|
@@ -124,7 +139,7 @@ class UnityEditor {
|
|
|
124
139
|
const activationSuccessful = stdout.includes("successfully activated") ||
|
|
125
140
|
(!stdout.includes("License activation failed") && !stderr.includes("License activation failed"));
|
|
126
141
|
if (activationSuccessful) {
|
|
127
|
-
console.
|
|
142
|
+
console.debug(`Successfully activated license for Unity ${projectInfo.editorVersion}`);
|
|
128
143
|
return true;
|
|
129
144
|
}
|
|
130
145
|
else {
|
|
@@ -148,7 +163,7 @@ class UnityEditor {
|
|
|
148
163
|
const returnSuccessful = stdout.includes("license return succeeded") ||
|
|
149
164
|
(!stdout.includes("Failed to return license") && !stderr.includes("Failed to return license"));
|
|
150
165
|
if (returnSuccessful) {
|
|
151
|
-
console.
|
|
166
|
+
console.debug(`Successfully returned license for Unity ${projectInfo.editorVersion}`);
|
|
152
167
|
return true;
|
|
153
168
|
}
|
|
154
169
|
else {
|
|
@@ -171,7 +186,7 @@ class UnityEditor {
|
|
|
171
186
|
});
|
|
172
187
|
const exportSuccessful = !stdout.includes("Failed to export package") && !stderr.includes("Failed to export package");
|
|
173
188
|
if (exportSuccessful) {
|
|
174
|
-
console.
|
|
189
|
+
console.debug(`Successfully exported package to ${outputPath}`);
|
|
175
190
|
return true;
|
|
176
191
|
}
|
|
177
192
|
else {
|
|
@@ -194,7 +209,7 @@ class UnityEditor {
|
|
|
194
209
|
});
|
|
195
210
|
const importSuccessful = !stdout.includes("Failed to import package") && !stderr.includes("Failed to import package");
|
|
196
211
|
if (importSuccessful) {
|
|
197
|
-
console.
|
|
212
|
+
console.debug(`Successfully imported package ${packagePath}`);
|
|
198
213
|
return true;
|
|
199
214
|
}
|
|
200
215
|
else {
|
|
@@ -222,7 +237,7 @@ class UnityEditor {
|
|
|
222
237
|
});
|
|
223
238
|
const creationSuccessful = !stdout.includes("Failed to create project") && !stderr.includes("Failed to create project");
|
|
224
239
|
if (creationSuccessful) {
|
|
225
|
-
console.
|
|
240
|
+
console.debug(`Successfully created project at ${projectInfo.projectPath}`);
|
|
226
241
|
return true;
|
|
227
242
|
}
|
|
228
243
|
else {
|
|
@@ -253,13 +268,12 @@ class UnityEditor {
|
|
|
253
268
|
const { stdout, stderr } = await this.execUnityEditorCommand(editorInfo, args, options);
|
|
254
269
|
const openingSuccessful = !stdout.includes("Failed to open project") && !stderr.includes("Failed to open project");
|
|
255
270
|
if (openingSuccessful) {
|
|
256
|
-
console.
|
|
257
|
-
return true;
|
|
271
|
+
console.debug(`Successfully opened project`);
|
|
258
272
|
}
|
|
259
273
|
else {
|
|
260
274
|
console.error(`Failed to open project: ${stderr || stdout}`);
|
|
261
|
-
return false;
|
|
262
275
|
}
|
|
276
|
+
return openingSuccessful;
|
|
263
277
|
}
|
|
264
278
|
catch (error) {
|
|
265
279
|
console.error("Error opening project:", error);
|
package/dist/esm/unityHub.js
CHANGED
|
@@ -39,7 +39,7 @@ class UnityHub {
|
|
|
39
39
|
}
|
|
40
40
|
static async isUnityHubAvailable() {
|
|
41
41
|
try {
|
|
42
|
-
return
|
|
42
|
+
return !!this.hubPath && fs.existsSync(this.hubPath);
|
|
43
43
|
}
|
|
44
44
|
catch (error) {
|
|
45
45
|
console.error("Error checking Unity Hub availability:", error);
|
|
@@ -138,7 +138,7 @@ class UnityHub {
|
|
|
138
138
|
throw error;
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
static async addEditor(version, modules = [], architecture
|
|
141
|
+
static async addEditor(version, modules = [], architecture) {
|
|
142
142
|
try {
|
|
143
143
|
const data = await getUnityChangeset(version);
|
|
144
144
|
const args = ["install", "-v", version];
|
|
@@ -147,9 +147,12 @@ class UnityHub {
|
|
|
147
147
|
args.push("--module");
|
|
148
148
|
args.push(modules.join(" "));
|
|
149
149
|
}
|
|
150
|
-
if (
|
|
151
|
-
|
|
150
|
+
if (!architecture) {
|
|
151
|
+
const arch = os.arch() || process.arch;
|
|
152
|
+
const defaultArchitecture = arch === "arm64" || arch === "arm" ? EditorArchitecture.arm64 : EditorArchitecture.x86_64;
|
|
153
|
+
architecture = defaultArchitecture;
|
|
152
154
|
}
|
|
155
|
+
args.push("--architecture", architecture);
|
|
153
156
|
const { stdout, stderr } = await this.execUnityHubCommand(args, {
|
|
154
157
|
reject: false,
|
|
155
158
|
});
|