Skip to content

Commit dcd5476

Browse files
authored
fix: normalize artifact paths in makeResult dryRunResume (#3206)
1 parent 0f73d64 commit dcd5476

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

packages/api/core/src/api/publish.ts

+10-7
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,16 @@ const publish = async ({
217217
d('restoring publish settings from dry run');
218218

219219
for (const makeResult of restoredMakeResults) {
220-
for (const makePath of makeResult.artifacts) {
221-
// standardize the path to artifacts across platforms
222-
const normalizedPath = makePath.split(/\/|\\/).join(path.sep);
223-
if (!(await fs.pathExists(normalizedPath))) {
224-
throw new Error(`Attempted to resume a dry run but an artifact (${normalizedPath}) could not be found`);
225-
}
226-
}
220+
makeResult.artifacts = await Promise.all(
221+
makeResult.artifacts.map(async (makePath: string) => {
222+
// standardize the path to artifacts across platforms
223+
const normalizedPath = makePath.split(/\/|\\/).join(path.sep);
224+
if (!(await fs.pathExists(normalizedPath))) {
225+
throw new Error(`Attempted to resume a dry run, but an artifact (${normalizedPath}) could not be found`);
226+
}
227+
return normalizedPath;
228+
})
229+
);
227230
}
228231

229232
d('publishing for given state set');

0 commit comments

Comments
 (0)