How to use the @ts-common/azure-js-dev-tools.commandToString function in @ts-common/azure-js-dev-tools

To help you get started, we’ve selected a few @ts-common/azure-js-dev-tools examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / ms-rest-js / .scripts / testDependentProjects.ts View on Github external
async function execAndLog(executable: string, args?: string[], options?: RunOptions): Promise {
  const command: Command = {
    executable,
    args,
  };

  console.log(`\n\nRunning ${commandToString(command)}`);

  const result: RunResult = await run(command, undefined, {
    ...options,
    log: console.log,
    showCommand: true,
    showResult: true,
  });

  console.log(`\nResult of "${commandToString(command)}" [Exit code: ${result.exitCode}]:\n` + result.stdout + "\n");

  if (result.exitCode) {
    console.error(`Error while running "${commandToString(command)}": ${result.error}`);
    throw new Error(result.stderr);
  }

  return Promise.resolve(result);
}
github Azure / azure-sdk-for-js / sdk / core / core-http / .scripts / testDependentProjects.ts View on Github external
async function execAndLog(executable: string, args?: string[], options?: RunOptions): Promise {
  const command: Command = {
    executable,
    args,
  };

  console.log(`\n\nRunning ${commandToString(command)}`);

  const result: RunResult = await run(command, undefined, {
    ...options,
    log: console.log,
    showCommand: true,
    showResult: true,
  });

  console.log(`\Result of "${commandToString(command)}" [Exit code: ${result.exitCode}]:\n` + result.stdout + "\n");

  if (result.exitCode) {
    console.error(`Error while running "${commandToString(command)}": ${result.error}`);
    throw new Error(result.stderr);
  }

  return Promise.resolve(result);
github Azure / ms-rest-js / .scripts / testDependentProjects.ts View on Github external
args,
  };

  console.log(`\n\nRunning ${commandToString(command)}`);

  const result: RunResult = await run(command, undefined, {
    ...options,
    log: console.log,
    showCommand: true,
    showResult: true,
  });

  console.log(`\nResult of "${commandToString(command)}" [Exit code: ${result.exitCode}]:\n` + result.stdout + "\n");

  if (result.exitCode) {
    console.error(`Error while running "${commandToString(command)}": ${result.error}`);
    throw new Error(result.stderr);
  }

  return Promise.resolve(result);
}
github Azure / azure-sdk-for-js / sdk / core / core-http / .scripts / testDependentProjects.ts View on Github external
args,
  };

  console.log(`\n\nRunning ${commandToString(command)}`);

  const result: RunResult = await run(command, undefined, {
    ...options,
    log: console.log,
    showCommand: true,
    showResult: true,
  });

  console.log(`\Result of "${commandToString(command)}" [Exit code: ${result.exitCode}]:\n` + result.stdout + "\n");

  if (result.exitCode) {
    console.error(`Error while running "${commandToString(command)}": ${result.error}`);
    throw new Error(result.stderr);
  }

  return Promise.resolve(result);
}