Skip to content

Commit

Permalink
fix: normalize artifact paths in makeResult dryRunResume (#3206)
Browse files Browse the repository at this point in the history
  • Loading branch information
VerteDinde committed Apr 4, 2023
1 parent 0f73d64 commit dcd5476
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions packages/api/core/src/api/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,16 @@ const publish = async ({
d('restoring publish settings from dry run');

for (const makeResult of restoredMakeResults) {
for (const makePath of makeResult.artifacts) {
// standardize the path to artifacts across platforms
const normalizedPath = makePath.split(/\/|\\/).join(path.sep);
if (!(await fs.pathExists(normalizedPath))) {
throw new Error(`Attempted to resume a dry run but an artifact (${normalizedPath}) could not be found`);
}
}
makeResult.artifacts = await Promise.all(
makeResult.artifacts.map(async (makePath: string) => {
// standardize the path to artifacts across platforms
const normalizedPath = makePath.split(/\/|\\/).join(path.sep);
if (!(await fs.pathExists(normalizedPath))) {
throw new Error(`Attempted to resume a dry run, but an artifact (${normalizedPath}) could not be found`);
}
return normalizedPath;
})
);
}

d('publishing for given state set');
Expand Down

0 comments on commit dcd5476

Please sign in to comment.