mirror of
https://github.com/redhat-actions/podman-login.git
synced 2025-02-22 18:11:21 +01:00
getDockerConfigJson(): Return empty auth when ~/.docker/config.json doesn't exist (#39)
This commit is contained in:
parent
a7d8d3e644
commit
bcf6f9c330
1 changed files with 2 additions and 1 deletions
|
@ -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; });
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue