本文整理汇总了TypeScript中chalk.bold.greenBright方法的典型用法代码示例。如果您正苦于以下问题:TypeScript bold.greenBright方法的具体用法?TypeScript bold.greenBright怎么用?TypeScript bold.greenBright使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chalk.bold
的用法示例。
在下文中一共展示了bold.greenBright方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: Promise
return new Promise((resolve, reject) => {
const vccParam = `-VisualStudioVersion '${BUILD_TOOLS.version.toString()}'`;
const pathParam = `-BuildToolsInstallerPath '${vccInstaller.directory}'`;
const buildToolsParam = IS_BUILD_TOOLS_INSTALLED
? ``
: `-InstallBuildTools -ExtraBuildToolsParameters '${getBuildToolsExtraParameters()}'`;
const pythonParam = IS_PYTHON_INSTALLED
? ``
: `-PythonInstaller '${pythonInstaller.fileName}' -InstallPython`;
const psArgs = `& {& '${installerScriptPath}' ${pathParam} ${buildToolsParam} ${pythonParam} ${vccParam} }`;
const args = ['-ExecutionPolicy', 'Bypass', '-NoProfile', '-NoLogo', psArgs];
debug(`Installer: Launching installer in ${vccInstaller.directory} with parameters ${args}.`);
let child;
try {
child = spawn('powershell.exe', args);
} catch (error) {
log(chalk.bold.red('Error: failed while trying to run powershell.exe.'));
log(chalk.bold.greenBright('Hint: Is "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0" in your system path?'));
log(`\nTried to execute: "powershell.exe ${args.join(' ')}"\n`);
return reject(error);
}
child.stdout.on('data', (data) => {
debug(`Installer: Stdout from launch-installer.ps1: ${data.toString()}`);
if (data.toString().includes('Please restart this script from an administrative PowerShell!')) {
log(chalk.bold.red('Please restart this script from an administrative PowerShell!'));
log('The build tools cannot be installed without administrative rights.');
log('To fix, right-click on PowerShell and run "as Administrator".');
// Bail out
process.exit(1);
}
});
child.stderr.on('data', (data) => debug(`Installer: Stderr from launch-installer.ps1: ${data.toString()}`));
child.on('exit', () => resolve());
child.stdin.end();
});