mirror of
https://github.com/redhat-actions/podman-login.git
synced 2025-02-23 10:31:21 +01:00
getDockerConfigJson(): Return empty auth when ~/.docker/config.json doesn't exist
This commit is contained in:
parent
a7d8d3e644
commit
8828a2343e
1 changed files with 2 additions and 1 deletions
|
@ -69,5 +69,6 @@ export async function execute(
|
||||||
|
|
||||||
export async function getDockerConfigJson(): Promise<string> {
|
export async function getDockerConfigJson(): Promise<string> {
|
||||||
const dockerConfigPath = path.join(os.homedir(), ".docker", "config.json");
|
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; });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue