This commit is contained in:
Daniel Rudolf 2024-08-07 09:35:09 +00:00 committed by GitHub
commit ce93d23e93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,7 +15,8 @@ import { Inputs } from "./generated/inputs-outputs";
let podmanPath: string | undefined;
let registry: string;
const dockerConfigPath = path.join(os.homedir(), ".docker", "config.json");
const dockerConfigDir = path.join(os.homedir(), ".docker");
const dockerConfigPath = path.join(dockerConfigDir, "config.json");
async function getPodmanPath(): Promise<string> {
if (podmanPath == null) {
@ -91,7 +92,8 @@ async function run(): Promise<void> {
dockerConfig.auths[registry] = generatedAuth;
await fs.writeFile(dockerConfigPath, JSON.stringify(dockerConfig, undefined, 8), "utf-8");
await fs.mkdir(dockerConfigDir, { recursive: true })
.then(() => fs.writeFile(dockerConfigPath, JSON.stringify(dockerConfig, undefined, 8), "utf-8"));
}
async function registryLogout(): Promise<void> {