()
| 116 | } |
| 117 | |
| 118 | function syncAuthToPodmanMachine() { |
| 119 | if (!isPodmanOnWindows()) { |
| 120 | return true; |
| 121 | } |
| 122 | |
| 123 | const authFile = getHostAuthFile(); |
| 124 | if (!authFile) { |
| 125 | console.error('Error: Docker Hub credentials not found on Windows.'); |
| 126 | console.error(`Log in locally, then retry push:`); |
| 127 | console.error(` podman login ${dockerHubRegistry()} -u <username> -p <access-token>`); |
| 128 | return false; |
| 129 | } |
| 130 | |
| 131 | try { |
| 132 | runQuiet('machine ssh sudo mkdir -p /root/.config/containers'); |
| 133 | run(`machine cp "${authFile}" podman-machine-default:/root/.config/containers/auth.json`); |
| 134 | return true; |
| 135 | } catch (error) { |
| 136 | console.error('Error: Failed to sync Docker Hub credentials into the Podman VM.'); |
| 137 | console.error(error.message); |
| 138 | return false; |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | module.exports = { |
| 143 | commandExists, |
nothing calls this directly
no test coverage detected