update deno commons mod
This commit is contained in:
@@ -28,14 +28,30 @@ export class ProcessOutput {
|
||||
return this;
|
||||
}
|
||||
|
||||
stdoutThenTrim(): string {
|
||||
return this.getStdoutAsStringThenTrim();
|
||||
}
|
||||
getStdoutAsStringThenTrim(): string {
|
||||
return this.stdout.trim();
|
||||
}
|
||||
|
||||
stderrThenTrim(): string {
|
||||
return this.getStderrAsStringThenTrim();
|
||||
}
|
||||
getStderrAsStringThenTrim(): string {
|
||||
return this.stderr.trim();
|
||||
}
|
||||
|
||||
stdoutAsJson(): any {
|
||||
return this.getStdoutAsJson();
|
||||
}
|
||||
getStdoutAsJson(): any {
|
||||
return JSON.parse(this.stdout);
|
||||
}
|
||||
|
||||
stderrAsJson(): any {
|
||||
return this.getStderrAsJson();
|
||||
}
|
||||
getStderrAsJson(): any {
|
||||
return JSON.parse(this.stderr);
|
||||
}
|
||||
@@ -44,7 +60,8 @@ export class ProcessOutput {
|
||||
export async function execCommandAndStdout(
|
||||
command: string,
|
||||
args?: string[],
|
||||
options?: Deno.CommandOptions,): Promise<string> {
|
||||
options?: Deno.CommandOptions,
|
||||
): Promise<string> {
|
||||
const processOutput = await execCommand(command, args, options);
|
||||
processOutput.assertSuccess();
|
||||
return processOutput.stdout.trim();
|
||||
|
||||
Reference in New Issue
Block a user