• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript shelljs.which函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript shiorif.Shiorif类代码示例发布时间:2022-05-25
下一篇:
TypeScript shelljs.touch函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap