当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript bold.green方法代码示例

本文整理汇总了TypeScript中chalk.bold.green方法的典型用法代码示例。如果您正苦于以下问题:TypeScript bold.green方法的具体用法?TypeScript bold.green怎么用?TypeScript bold.green使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在chalk.bold的用法示例。


在下文中一共展示了bold.green方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: debug

    tailer.on('exit', (result, details) => {
      debug('python tailer exited');
      if (result === 'error') {
        debug('Installer: Tailer found error with installer', details);
        reject(new Error(`Found error with Python installer: ${details}`));
      }

      if (result === 'success') {
        pythonLastLines = [ chalk.bold.green('Successfully installed Python 2.7') ];

        debug('Installer: Successfully installed Python 2.7 according to tailer');
        resolve({
          installPath: details || getPythonInstallerPath().targetPath,
          toConfigure: true,
          success: true
        });
      }

      if (result === 'failure') {
        log(chalk.bold.red('\nCould not install Python 2.7.'));
        log('Please find more details in the log files, which can be found at');
        log(getWorkDirectory() + '\n');

        debug('Installer: Failed to install Python 2.7 according to tailer');
        resolve({
          success: false
        });
      }
    });
开发者ID:felixrieseberg,项目名称:windows-build-tools,代码行数:29,代码来源:index.ts

示例2: success

export function success(...args: any[]) {
  if (args.length > 1) {
    args[0] = chalk.bold.green(args[0]);
  }

  log.apply(console, args);
}
开发者ID:janpersiel,项目名称:stylegen,代码行数:7,代码来源:Logger.ts

示例3: function

 conn.on('ready', function() {
   console.log(chalk.bold.green('Connected to node1 as root'));
   conn.shell(function(err, stream) {
     if (err) throw err;
     stream.on('close', function() {
       if (errorMsg.length > 0) {
         console.log(chalk.bold.red('Error is:') + errorMsg);
         console.log(chalk.red.bgBlack.bold('Unable to truncate metron_update table in HBase. Most likely reason is HBase is down !!!'));
         reject();
       } else {
         console.log(chalk.bold.green('Truncated metron_update table in HBase'));
         resolve();
       }
       conn.end();
     }).on('data', function(data) {
       console.log('STDOUT: ' + data);
       if (data.indexOf('ERROR') !== -1) {
         errorMsg = data;
       }
     }).stderr.on('data', function(data) {
       console.log('STDERR: ' + data);
     });
     var comands = [
       'echo \'truncate "metron_update"\' | /usr/hdp/current/hbase-master/bin/hbase shell',
       'exit',
       ''
     ];
     stream.end(comands.join('\r\n'));
   });
 }).connect({
开发者ID:JonZeolla,项目名称:incubator-metron,代码行数:30,代码来源:clean_metron_update_table.ts

示例4: switch

 diffResult.diffSet.forEach(function(entry) {
   switch (entry.state) {
     case 'equal':
       return;
     case 'left':
       const expectedFileRelPath =
           path.join(entry.relativePath || '/', entry.name1);
       errorOutputLines.push((chalk.bold.green(' + ' + expectedFileRelPath)));
       return;
     case 'right':
       const actualFileRelPath =
           path.join(entry.relativePath || '/', entry.name2);
       errorOutputLines.push((chalk.bold.red(' - ' + actualFileRelPath)));
       return;
     case 'distinct':
       const diffedFileRelPath =
           path.join(entry.relativePath || '/', entry.name1);
       const expectedFilePath = path.join(entry.path1, entry.name1);
       const actualFilePath = path.join(entry.path2, entry.name2);
       const patch = diff.createPatch(
           'string',
           fs.readFileSync(expectedFilePath, 'utf8'),
           fs.readFileSync(actualFilePath, 'utf8'),
           'expected',
           'converted');
       errorOutputLines.push((chalk.bold.red('<> ' + diffedFileRelPath)));
       errorOutputLines.push(formatDiffPatch(patch));
       return;
     default:
       throw new Error('Unexpected diff-entry format: ' + entry);
   }
 });
开发者ID:,项目名称:,代码行数:32,代码来源:

示例5: _drawUIDoneWithSkipped

  private _drawUIDoneWithSkipped() {
    this._pipe.write(CLEAR);
    const numPass = this._countPaths - this._testAssertions.length;

    let stats = chalk.bold.dim(
      pluralize('snapshot', this._countPaths) + ' reviewed',
    );
    if (numPass) {
      stats +=
        ', ' + chalk.bold.green(pluralize('snapshot', numPass) + ' updated');
    }
    if (this._skippedNum) {
      stats +=
        ', ' +
        chalk.bold.yellow(pluralize('snapshot', this._skippedNum) + ' skipped');
    }
    const messages = [
      '\n' + chalk.bold('Interactive Snapshot Result'),
      ARROW + stats,
      '\n' + chalk.bold('Watch Usage'),

      chalk.dim(ARROW + 'Press ') +
        'r' +
        chalk.dim(' to restart Interactive Snapshot Mode.'),

      chalk.dim(ARROW + 'Press ') +
        'q' +
        chalk.dim(' to quit Interactive Snapshot Mode.'),
    ];

    this._pipe.write(messages.filter(Boolean).join('\n') + '\n');
  }
开发者ID:Volune,项目名称:jest,代码行数:32,代码来源:SnapshotInteractiveMode.ts

示例6: constructor

  constructor(oldCmd: string, newCmd: string) {
    super(
      `The ${chalk.bold(oldCmd)} command has been replaced by the ${chalk.bold(
        newCmd,
      )} command.
Get more info with ${chalk.bold.green(`${newCmd} --help`)}`,
    )
  }
开发者ID:dhruvcodeword,项目名称:prisma,代码行数:8,代码来源:CommandReplacedError.ts

示例7: setEnvironment

export function setEnvironment(env: InstallationDetails): Promise<void> {
  const scriptPath = IS_DRY_RUN
    ? path.join(__dirname, '..', 'ps1', 'dry-run.ps1')
    : path.join(__dirname, '..', 'ps1', 'set-environment.ps1');

  let pythonArguments = '';
  let buildArguments = '';

  // Should we configure Python?
  if (env.python.toConfigure) {
    const pythonPath = path.join(env.python.installPath);
    const pythonExePath = path.join(pythonPath, 'python.exe');

    pythonArguments += ` -ConfigurePython -pythonPath '${pythonPath}' -pythonExePath '${pythonExePath}'`;
  }

  // Should we configure the VS Build Tools?
  if (env.buildTools.toConfigure) {
    const vccParam = `-VisualStudioVersion '${BUILD_TOOLS.version.toString()}'`;
    buildArguments += ` -ConfigureBuildTools ${vccParam}`;
  }

  // Log what we're doing
  if (pythonArguments && buildArguments) {
    log(chalk.bold.green(`Now configuring the Visual Studio Build Tools and Python...`));
  } else if (pythonArguments) {
    log(chalk.bold.green(`Now configuring Python...`));
  } else if (buildArguments) {
    log(chalk.bold.green(`Now configuring the Visual Studio Build Tools..`));
  } else {
    log(chalk.bold.green(`Skipping configuration: No configuration for Python or Visual Studio Build Tools required.`));
    return(new Promise((resolve, reject) => resolve()))
      .then(() => log(chalk.bold.green(`\nAll done!\n`)));
  }

  const maybeArgs = `${pythonArguments}${buildArguments}`;
  const psArgs = `& {& '${scriptPath}' ${maybeArgs} }`;
  const args = ['-ExecutionPolicy', 'Bypass', '-NoProfile', '-NoLogo', psArgs];

  return executeChildProcess('powershell.exe', args)
    .then(() => log(chalk.bold.green(`\nAll done!\n`)))
    .catch((error) => debug(`Encountered environment setting error: ${error}`));
}
开发者ID:felixrieseberg,项目名称:windows-build-tools,代码行数:43,代码来源:environment.ts

示例8: createReporterError

export function createReporterError(
  reporterIndex: number,
  reporterValue: Array<Config.ReporterConfig> | string,
) {
  const errorMessage =
    `  Reporter at index ${reporterIndex} must be of type:\n` +
    `    ${chalk.bold.green(validReporterTypes.join(' or '))}\n` +
    `  but instead received:\n` +
    `    ${chalk.bold.red(getType(reporterValue))}`;

  return new ValidationError(ERROR, errorMessage, DOCUMENTATION_NOTE);
}
开发者ID:Volune,项目名称:jest,代码行数:12,代码来源:ReporterValidationErrors.ts


注:本文中的chalk.bold.green方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。