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 writeActions: (() => Promise<void>)[] = [];
|
||||
|
||||
for (const { uiModuleMeta, fileRelativePaths } of arr) {
|
||||
const uiModuleDirPath = await getInstalledModuleDirPath({
|
||||
moduleName: uiModuleMeta.moduleName,
|
||||
@ -84,9 +86,11 @@ export async function command(params: {
|
||||
uiModuleVersion: uiModuleMeta.version
|
||||
});
|
||||
|
||||
await fsPr.writeFile(
|
||||
pathJoin(buildContext.themeSrcDirPath, fileRelativePath),
|
||||
sourceCode
|
||||
writeActions.push(() =>
|
||||
fsPr.writeFile(
|
||||
pathJoin(buildContext.themeSrcDirPath, fileRelativePath),
|
||||
sourceCode
|
||||
)
|
||||
);
|
||||
|
||||
ownedFilesRelativePaths_toAdd.push(fileRelativePath);
|
||||
@ -98,6 +102,8 @@ export async function command(params: {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
await Promise.all(writeActions.map(action => action()));
|
||||
|
||||
await writeManagedGitignoreFile({
|
||||
buildContext,
|
||||
uiModuleMetas,
|
||||
|
Loading…
x
Reference in New Issue
Block a user