Skip to content

Commit 8822a66

Browse files
update comments
1 parent 772e020 commit 8822a66

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/unity-editor.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,11 @@ export class UnityEditor {
110110
return undefined;
111111
}
112112

113-
// Build a regex to match the template name and an optional numeric version suffix
113+
// Build a regex to match the template name, an optional numeric version suffix, and required file extension
114114
// Example input: com.unity.template.3d(-cross-platform)?.*
115-
// Example match: com.unity.template.3d-cross-platform-1.2.3 or com.unity.template.3d-1.2.3.tgz
115+
// Example match: com.unity.template.3d-cross-platform-1.2.3.tar.gz or com.unity.template.3d-1.2.3.tgz
116116
let regex: RegExp;
117117
try {
118-
// allow either no suffix, the numeric suffix, then required .tgz or .tar.gz
119118
regex = new RegExp(`^${template}(?:-\\d+\\.\\d+\\.\\d+)?(?:\\.tgz|\\.tar\\.gz)$`);
120119
} catch (e) {
121120
throw new Error(`Invalid template regex: ${template}`);

0 commit comments

Comments
 (0)