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