mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
3.6 bugfix build template replace proj_name (#11654)
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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)}`);
|
||||
|
||||
Reference in New Issue
Block a user