Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

Commit

Permalink
fix: handle 404 from registry if the host cli hasn't published any pa…
Browse files Browse the repository at this point in the history
…ckages
  • Loading branch information
kamal committed Jun 22, 2021
1 parent 90bfa6f commit 800a546
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/hooks/init/check-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ const hook: Hook<"init"> = async function ({ config }) {
await fs.writeFile(updateCheckPath, JSON.stringify(latestManifest), {
encoding: "utf8",
});
} catch (error) {
// when the host has not yet published any packages, the registry will return a 404.
// we swallow this error to avoid erroring out the host cli
if (error.code !== "E404") {
throw error;
}
} finally {
cli.action.stop();
}
Expand Down

0 comments on commit 800a546

Please sign in to comment.