Skip to content

Commit

Permalink
Fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
haenah committed Feb 2, 2023
1 parent a06f1f3 commit 74cc54a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/team/component/santa/spec-fetcher/src/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,12 @@ const fetcher = async (opts: FetcherOptions) => {
yield true;
continue;
} else {
await fs.rmdir(specOutputDir, { recursive: true });
try {
await fs.access(specOutputDir);
await fs.rmdir(specOutputDir, { recursive: true });
} catch (e) {
// noop
}
}

console.log(`📥 Downloading ${specName}...`);
Expand All @@ -134,6 +139,7 @@ const fetcher = async (opts: FetcherOptions) => {
Please check artifacts of glob pattern "${filenamePattern}" in version "${releaseTitle}" exists.`,
);
}
await fs.access(specOutputDir);
yield true;
} catch (e) {
console.error(e);
Expand Down

0 comments on commit 74cc54a

Please sign in to comment.