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


TypeScript shelljs.which函数代码示例

本文整理汇总了TypeScript中shelljs.which函数的典型用法代码示例。如果您正苦于以下问题:TypeScript which函数的具体用法?TypeScript which怎么用?TypeScript which使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: function

var resolveCapabilityViaShell = function(filteredEnv: any, command: string, args: string, capability: string) {
    var tool = shell.which(command);
    if (!tool) {
        return;
    }

    var val = shell.exec(command + ' ' + args, {silent:true}).output;
    if (val) {
        setCapability(filteredEnv, capability, val);
    }
}
开发者ID:ElleCox,项目名称:vso-agent,代码行数:11,代码来源:environment.ts

示例2: getCredentials

export function getCredentials() {
  if (!shell.which('git')) {
    return vscode.window.showErrorMessage("Sorry, git must be installed.");
  }
  var user
  return getUser().then( u => {
    user = u;
    return getPass()
  })
  .then(p =>
      Promise.resolve({
        user: user,
        pass: p,
        sendImmediately: true
      })
    )
}
开发者ID:satokaz,项目名称:vscode-gist,代码行数:17,代码来源:auth.ts

示例3: require

/// <reference path="../../../definitions/mocha.d.ts"/>
/// <reference path="../../../definitions/node.d.ts"/>
/// <reference path="../../../definitions/Q.d.ts"/>

import Q = require('q');
import psm = require('../../lib/psRunner');
import path = require('path');
var shell = require('shelljs');
var ps = shell.which('powershell');
var psr = null;

describe('SonarQubePreBuild Suite', function () {
    this.timeout(20000);

    before((done) => {
        if (ps) {
            psr = new psm.PSRunner();
            psr.start();
        }

        done();
    });

    after(function () {
        psr.kill();
    });

    if (ps) {
        it('CreateCommandLineArgs tests', (done) => {
            psr.run(path.join(__dirname, 'CreateCommandLineArgs.ps1'), done);
        })
开发者ID:Alekseypv,项目名称:vsts-tasks,代码行数:31,代码来源:_suite.ts

示例4: require

/// <reference path="../../../definitions/mocha.d.ts"/>
/// <reference path="../../../definitions/node.d.ts"/>
/// <reference path="../../../definitions/Q.d.ts"/>

import Q = require('q');
import assert = require('assert');
import trm = require('../../lib/taskRunner');
import psm = require('../../lib/psRunner');
import path = require('path');
var shell = require('shelljs');
var ps = shell.which('powershell.exe');
var psr = null;

describe('VSBuild Suite', function () {
    this.timeout(20000);

    before((done) => {
        if (ps) {
            psr = new psm.PSRunner();
            psr.start();
        }

        done();
    });

    after(function () {
        psr.kill();
    });

    if (ps) {
        it('(Select-MSBuildLocation) maps vs versions', (done) => {
开发者ID:HSAR,项目名称:vso-agent-tasks,代码行数:31,代码来源:_suite.ts

示例5: constructor

	constructor(location: string) {
		this.repo = location;
		this.git = shell.which('git');
	}
开发者ID:ElleCox,项目名称:vso-agent,代码行数:4,代码来源:gitrepo.ts

示例6: removeItems

      ),
      pattern: /^(y(es)?|n(o)?)$/i,
      type: "string",
      required: true,
      message: 'You need to type "Yes" or "No" to continue...'
    }
  }
}

_prompt.start()
_prompt.message = ""

// Clear console
process.stdout.write('\x1B[2J\x1B[0f');

if (!which("git")) {
  console.log(colors.red("Sorry, this script requires git"))
  removeItems()
  process.exit(1)
}

// Say hi!
console.log(
  colors.cyan("Hi! You're almost ready to make the next great TypeScript library.")
)

// Generate the library name and start the tasks
if (process.env.CI == null) {
  if (!libraryNameSuggestedIsDefault()) {
    libraryNameSuggestedAccept()
  } else {
开发者ID:robertrbairdii,项目名称:typescript-library-starter,代码行数:31,代码来源:init.ts

示例7: showUsage

// servicename: vsoagent.{accountName}.{agentName}
var cfg = cfgm.read();
var hostName = url.parse(cfg.serverUrl).hostname;
var accountName = hostName.split('.')[0];
var agentName = cfg.agentName;
var svcName = 'vsoagent.' + accountName + '.' + agentName;
console.log('serviceName: vsoagent.' + svcName);
var svcinstall = new si.SvcInstall();

/*
if (typeof svcinstall[action] !== 'function') {
    showUsage(1);
}*/

// node is known as nodejs on some *nix installs
var nodePath = shelljs.which('nodejs') || shelljs.which('node');
var getSvcCfg = function () {
    if (!shelljs.test('-f', _cfgPath)) {
        console.error('Error: not configured as a service.  use install action.');
        return null;
    }
    var svcCfg = JSON.parse(fs.readFileSync(_cfgPath).toString());
    return svcCfg;
};

var runAction = function (action, item): Q.Promise<void> {
    var defer = Q.defer<void>();

    console.log();
    console.log(action + ' ' + item);
    svcinstall[action](item, function (err) {
开发者ID:itsananderson,项目名称:vso-agent,代码行数:31,代码来源:service.ts

示例8: getShellWhich

export function getShellWhich(moduleName: string): string {
    return shell.which(moduleName);
}
开发者ID:Microsoft,项目名称:vsts-rm-extensions,代码行数:3,代码来源:ansibleUtils.ts


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