Optimization and potentially prevend leaving the repo in a broken state
This commit is contained in:
parent
cc3d0d61dd
commit
6de5fd4f96
@ -60,6 +60,8 @@ export async function command(params: {
|
|||||||
|
|
||||||
const ownedFilesRelativePaths_toAdd: string[] = [];
|
const ownedFilesRelativePaths_toAdd: string[] = [];
|
||||||
|
|
||||||
|
const writeActions: (() => Promise<void>)[] = [];
|
||||||
|
|
||||||
for (const { uiModuleMeta, fileRelativePaths } of arr) {
|
for (const { uiModuleMeta, fileRelativePaths } of arr) {
|
||||||
const uiModuleDirPath = await getInstalledModuleDirPath({
|
const uiModuleDirPath = await getInstalledModuleDirPath({
|
||||||
moduleName: uiModuleMeta.moduleName,
|
moduleName: uiModuleMeta.moduleName,
|
||||||
@ -84,9 +86,11 @@ export async function command(params: {
|
|||||||
uiModuleVersion: uiModuleMeta.version
|
uiModuleVersion: uiModuleMeta.version
|
||||||
});
|
});
|
||||||
|
|
||||||
await fsPr.writeFile(
|
writeActions.push(() =>
|
||||||
|
fsPr.writeFile(
|
||||||
pathJoin(buildContext.themeSrcDirPath, fileRelativePath),
|
pathJoin(buildContext.themeSrcDirPath, fileRelativePath),
|
||||||
sourceCode
|
sourceCode
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
ownedFilesRelativePaths_toAdd.push(fileRelativePath);
|
ownedFilesRelativePaths_toAdd.push(fileRelativePath);
|
||||||
@ -98,6 +102,8 @@ export async function command(params: {
|
|||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await Promise.all(writeActions.map(action => action()));
|
||||||
|
|
||||||
await writeManagedGitignoreFile({
|
await writeManagedGitignoreFile({
|
||||||
buildContext,
|
buildContext,
|
||||||
uiModuleMetas,
|
uiModuleMetas,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user