feat(cli): support collection level authorization and headers (#3636)

This commit is contained in:
James George
2023-12-14 12:43:22 +05:30
committed by GitHub
parent c47e2e7767
commit 9bc81a6d67
5 changed files with 373 additions and 104 deletions

View File

@@ -1,10 +1,17 @@
import { exec } from "child_process";
import { resolve } from "path";
import { ExecResponse } from "./types";
export const execAsync = (command: string): Promise<ExecResponse> =>
new Promise((resolve) =>
exec(command, (error, stdout, stderr) => resolve({ error, stdout, stderr }))
);
export const runCLI = (args: string): Promise<ExecResponse> =>
{
const CLI_PATH = resolve(__dirname, "../../bin/hopp");
const command = `node ${CLI_PATH} ${args}`
return new Promise((resolve) =>
exec(command, (error, stdout, stderr) => resolve({ error, stdout, stderr }))
);
}
export const trimAnsi = (target: string) => {
const ansiRegex =