fix(package): ensure `electron-packager` throws if fails (#3136)

This commit is contained in:
Erick Zhao 2023-01-11 10:29:11 -08:00 коммит произвёл GitHub
Родитель 6a118c6c9c
Коммит 4c813a7905
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 9 добавлений и 6 удалений

Просмотреть файл

@ -165,11 +165,6 @@ export const listrPackage = ({
task.output = 'Determining targets...';
let provideTargets: (targets: TargetDefinition[]) => void;
const targetsPromise = new Promise<InternalTargetDefinition[]>((resolve) => {
provideTargets = resolve;
});
type StepDoneSignalMap = Map<string, (() => void)[]>;
const signalCopyDone: StepDoneSignalMap = new Map();
const signalRebuildDone: StepDoneSignalMap = new Map();
@ -186,6 +181,12 @@ export const listrPackage = ({
});
};
let provideTargets: (targets: TargetDefinition[]) => void;
const targetsPromise = new Promise<InternalTargetDefinition[]>((resolve, reject) => {
provideTargets = resolve;
rejects.push(reject);
});
const rebuildTasks = new Map<string, Promise<ForgeListrTask<never>>[]>();
const signalRebuildStart = new Map<string, ((task: ForgeListrTask<never>) => void)[]>();
@ -309,7 +310,9 @@ export const listrPackage = ({
// rejects is populated by the reject handlers for every
// signal based promise in every subtask
ctx.packagerPromise.catch((err) => {
for (const reject of rejects) reject(err);
for (const reject of rejects) {
reject(err);
}
});
const targets = await targetsPromise;