From 8828a2343efc255ad6682f4cd9db89ad021b6de9 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Sun, 17 Dec 2023 00:22:26 +0100 Subject: [PATCH] getDockerConfigJson(): Return empty auth when ~/.docker/config.json doesn't exist --- src/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index bfc7ad6..ee83a2d 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -69,5 +69,6 @@ export async function execute( export async function getDockerConfigJson(): Promise { 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; }); }