mirror of
https://github.com/redhat-actions/podman-login.git
synced 2025-03-31 22:27:47 +02:00
Merge 913e9b2934
into 4934294ad0
This commit is contained in:
commit
ce93d23e93
1 changed files with 4 additions and 2 deletions
|
@ -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> {
|
||||
|
|
Loading…
Add table
Reference in a new issue