Skip to content

Commit db77945

Browse files
authored
Merge pull request #706 from Frankkkkk/patch-1
docker auth: improve missing user/pwd
2 parents 70fccc7 + bfd28af commit db77945

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

dist/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/docker.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@ export async function logout(registry: string): Promise<void> {
2121
}
2222

2323
export async function loginStandard(registry: string, username: string, password: string): Promise<void> {
24-
if (!username || !password) {
24+
if (!username && !password) {
2525
throw new Error('Username and password required');
2626
}
27+
if (!username) {
28+
throw new Error('Username required');
29+
}
30+
if (!password) {
31+
throw new Error('Password required');
32+
}
2733

2834
const loginArgs: Array<string> = ['login', '--password-stdin'];
2935
loginArgs.push('--username', username);

0 commit comments

Comments
 (0)