export async function installDeno()

in src/utils/installRuntime.ts [49:78]


export async function installDeno(): Promise<boolean> {
  let installCommand: string;
  const __dirname = getDirName(import.meta.url);
  const p = path.join(__dirname, './install');

  switch (os.platform()) {
    case 'win32':
      installCommand = `powershell.exe -Command "Get-Content '${p}/install.ps1' | iex"`;
      break;
    case 'darwin':
    case 'linux':
      installCommand = `sh ${p}/install.sh`;
      break;
    default:
      installCommand = `sh ${p}/install.sh`;
  }
  logger.warn(
    t('install_runtime_tip').d(
      `🔔 Runtime must be installed to use esa dev. Installing...`
    )
  );
  try {
    execSync(installCommand, { stdio: 'inherit' });
    logger.success(t('install_runtime_success').d(`Runtime installed.`));
    return true;
  } catch (error) {
    logger.error(`Failed to install: ${(error as Error).message}`);
    return false;
  }
}