Skip to content

Commit bab6937

Browse files
committed
task: added stdin for passwords
1 parent 8c19c20 commit bab6937

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ export const dockerCommand = async (
176176
echo: true,
177177
env: undefined,
178178
machineName: undefined,
179+
stdin: undefined
179180
},
180181
) => {
181182
let machineconfig = "";
@@ -216,6 +217,10 @@ export const dockerCommand = async (
216217
},
217218
);
218219

220+
if (options.stdin) {
221+
childProcess.stdin.write(options.stdin);
222+
}
223+
219224
if (options.echo) {
220225
childProcess.stdout.on("data", (chunk) => {
221226
process.stdout.write(chunk.toString());
@@ -240,6 +245,7 @@ export class Docker {
240245
echo: true,
241246
env: undefined,
242247
machineName: undefined,
248+
stdin: undefined
243249
},
244250
) {}
245251

@@ -253,6 +259,7 @@ export interface IOptions {
253259
currentWorkingDirectory?: string;
254260
echo?: boolean;
255261
env?: NodeJS.ProcessEnv;
262+
stdin?: string;
256263
}
257264

258265
export class Options implements IOptions {
@@ -261,5 +268,6 @@ export class Options implements IOptions {
261268
public currentWorkingDirectory?: string,
262269
public echo: boolean = true,
263270
public env?: NodeJS.ProcessEnv,
271+
public stdin?: string,
264272
) {}
265273
}

0 commit comments

Comments
 (0)