所有console.logs都在运行,但根本没有创建文件夹和文件。我做错了什么?
您可以假设定义了this
的所有内容
public writeFiles = () => {
console.log('writing files');
const folderPath = `~/dev/generated-projects/${this.projectName}/server/api/routes/${this.structure.name}`;
console.log('folder path', folderPath);
fsPath.writeFileSync(path.join(folderPath, 'index.ts'), this.indexFile);
fsPath.writeFileSync(path.join(folderPath, 'routes.ts'), this.routesFile);
fsPath.writeFileSync(path.join(folderPath, 'helpers.ts'), this.helperFile);
console.log('create routes for ', this.structure.name);
}