mirror of
https://github.com/docker/login-action.git
synced 2025-07-04 23:04:16 +00:00
Take the password from stdin
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
53f337dbae
commit
6e236fe59d
3 changed files with 15 additions and 8 deletions
10
src/exec.ts
10
src/exec.ts
|
@ -7,13 +7,19 @@ export interface ExecResult {
|
|||
stderr: string;
|
||||
}
|
||||
|
||||
export const exec = async (command: string, args: string[] = [], silent: boolean): Promise<ExecResult> => {
|
||||
export const exec = async (
|
||||
command: string,
|
||||
args: string[] = [],
|
||||
silent: boolean,
|
||||
stdin?: string
|
||||
): Promise<ExecResult> => {
|
||||
let stdout: string = '';
|
||||
let stderr: string = '';
|
||||
|
||||
const options: ExecOptions = {
|
||||
silent: silent,
|
||||
ignoreReturnCode: true
|
||||
ignoreReturnCode: true,
|
||||
input: Buffer.from(stdin || '')
|
||||
};
|
||||
options.listeners = {
|
||||
stdout: (data: Buffer) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue