3.6 bugfix build template replace proj_name (#11654)

This commit is contained in:
江战
2022-06-22 17:57:25 +08:00
committed by GitHub
parent 8e773bb75b
commit 79b928fe65
2 changed files with 5 additions and 0 deletions
@@ -83,6 +83,10 @@ export abstract class NativePackTool {
init(params: CocosParams<Object>) {
this.params = new CocosParams(params);
this.paths = new Paths(params);
this.setEnv('NATIVE_DIR', this.paths.platformTemplateDirInPrj);
this.setEnv('COMMON_DIR', this.paths.commonDirInPrj);
this.setEnv('PROJECT_NAME', this.params.projectName);
}
protected parseVersion(content: string, key: string, def: number): number {
+1
View File
@@ -280,6 +280,7 @@ export class cchelper {
static async replaceInFile(patterns: { reg: string, text: string }[], filepath: string) {
filepath = this.replaceEnvVariables(filepath);
if (!fs.existsSync(filepath)) {
console.log(`While replace template content, file ${filepath}`);
return;
}
// console.log(`replace ${filepath} with ${JSON.stringify(patterns)}`);