function runCommand(command, cwd) {
  console.log(`running '${command}' in '${cwd}'`);
  if (cwd && !fs.existsSync(cwd)) {
    throw `working directory ${cwd} doesn't exist.`;
  }

  execSync(command, { stdio: "inherit", cwd });
}
Run a command synchronously in the specified directory and log command
@param {string} command - The command to run
@param {string|undefined} cwd - The current working directory (optional)