fix: 复制项目时要带有.gitignore和oak.config.json两个文件
This commit is contained in:
parent
00dab2c454
commit
1939358367
|
|
@ -248,6 +248,12 @@ async function create(dirName, cmd) {
|
||||||
(0, file_handle_1.checkFileExistsAndCreate)(tsConfigMpJsonPath, tsConfigMpJson, enum_1.checkFileExistsAndCreateType.FILE);
|
(0, file_handle_1.checkFileExistsAndCreate)(tsConfigMpJsonPath, tsConfigMpJson, enum_1.checkFileExistsAndCreateType.FILE);
|
||||||
// 创建tsconfig.web.json
|
// 创建tsconfig.web.json
|
||||||
(0, file_handle_1.checkFileExistsAndCreate)(tsConfigWebJsonPath, tsConfigWebJson, enum_1.checkFileExistsAndCreateType.FILE);
|
(0, file_handle_1.checkFileExistsAndCreate)(tsConfigWebJsonPath, tsConfigWebJson, enum_1.checkFileExistsAndCreateType.FILE);
|
||||||
|
// 复制.gitignore
|
||||||
|
const gitignoreContent = (0, file_handle_1.readFile)((0, path_1.join)(__dirname, '..', 'template', '.gitignore'));
|
||||||
|
(0, file_handle_1.checkFileExistsAndCreate)((0, path_1.join)(rootPath, '.gitignore'), gitignoreContent, enum_1.checkFileExistsAndCreateType.FILE);
|
||||||
|
// 复制oak.config.json
|
||||||
|
const oakConfigContent = (0, file_handle_1.readFile)((0, path_1.join)(__dirname, '..', 'template', config_1.USER_CONFIG_FILE_NAME));
|
||||||
|
(0, file_handle_1.checkFileExistsAndCreate)((0, path_1.join)(rootPath, config_1.USER_CONFIG_FILE_NAME), oakConfigContent, enum_1.checkFileExistsAndCreateType.FILE);
|
||||||
// 更新configuration/compiler.js (仅在非模块化模式下)
|
// 更新configuration/compiler.js (仅在非模块化模式下)
|
||||||
if (!isModule) {
|
if (!isModule) {
|
||||||
(0, template_1.updateCompilerJsContent)(rootPath, deps);
|
(0, template_1.updateCompilerJsContent)(rootPath, deps);
|
||||||
|
|
|
||||||
|
|
@ -370,6 +370,20 @@ export async function create(dirName: string, cmd: any) {
|
||||||
tsConfigWebJson,
|
tsConfigWebJson,
|
||||||
checkFileExistsAndCreateType.FILE
|
checkFileExistsAndCreateType.FILE
|
||||||
);
|
);
|
||||||
|
// 复制.gitignore
|
||||||
|
const gitignoreContent = readFile(join(__dirname, '..', 'template', '.gitignore'));
|
||||||
|
checkFileExistsAndCreate(
|
||||||
|
join(rootPath, '.gitignore'),
|
||||||
|
gitignoreContent,
|
||||||
|
checkFileExistsAndCreateType.FILE
|
||||||
|
);
|
||||||
|
// 复制oak.config.json
|
||||||
|
const oakConfigContent = readFile(join(__dirname, '..', 'template', USER_CONFIG_FILE_NAME));
|
||||||
|
checkFileExistsAndCreate(
|
||||||
|
join(rootPath, USER_CONFIG_FILE_NAME),
|
||||||
|
oakConfigContent,
|
||||||
|
checkFileExistsAndCreateType.FILE
|
||||||
|
);
|
||||||
// 更新configuration/compiler.js (仅在非模块化模式下)
|
// 更新configuration/compiler.js (仅在非模块化模式下)
|
||||||
if (!isModule) {
|
if (!isModule) {
|
||||||
updateCompilerJsContent(rootPath, deps);
|
updateCompilerJsContent(rootPath, deps);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue