getDockerConfigJson(): Return empty auth when ~/.docker/config.json doesn't exist (#39)

This commit is contained in:
Daniel Rudolf 2024-03-16 17:35:46 +01:00 committed by GitHub
parent a7d8d3e644
commit bcf6f9c330
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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; });
}