Skip to content

Commit

Permalink
getDockerConfigJson(): Return empty auth when ~/.docker/config.json d…
Browse files Browse the repository at this point in the history
…oesn't exist
  • Loading branch information
PhrozenByte committed Dec 16, 2023
1 parent a7d8d3e commit 8828a23
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,6 @@ export async function execute(

export async function getDockerConfigJson(): Promise<string> {
const dockerConfigPath = path.join(os.homedir(), ".docker", "config.json");
return fs.readFile(dockerConfigPath, "utf-8");
return fs.readFile(dockerConfigPath, "utf-8")
.catch((err) => { if (err.code === 'ENOENT') { return '{"auths":{}}'; } throw err; });
}

0 comments on commit 8828a23

Please sign in to comment.