本文整理汇总了TypeScript中bower.commands.install方法的典型用法代码示例。如果您正苦于以下问题:TypeScript commands.install方法的具体用法?TypeScript commands.install怎么用?TypeScript commands.install使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bower.commands
的用法示例。
在下文中一共展示了commands.install方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: done
(done) => {
bower.commands
.install(null,
{ save: true },
{ interactive: false }
)
.on('error',
console.error.bind(console))
.on('end', () => {
done();
});
});
示例2: installPackage
function installPackage(name: string, options: any) {
progressIndicator.beginTask("bower install");
bower.commands
.install([name], options, { interactive: true })
.on('error', function(error) {
progressIndicator.endTask("bower install");
adapter.logError(error);
vscode.window.showErrorMessage('bower install failed! View Output window for further details');
}).on('log', function(msg) {
adapter.log(msg);
}).on('end', function() {
progressIndicator.endTask("bower install");
vscode.window.showInformationMessage("bower package '" + name + "' successfully installed!");
}).on('prompt', function(prompts, callback) {
adapter.prompt(prompts, callback);
});
}
示例3: restore
// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
export default function restore(adapter: CodeAdapter, progressIndicator:ProgressIndicator) {
progressIndicator.beginTask("bower install");
var bower = require('bower');
bower.commands
.install(null, null, { interactive: true })
.on('error', function(error) {
progressIndicator.endTask("bower install");
adapter.logError(error);
vscode.window.showErrorMessage('bower install failed! View Output window for further details');
}).on('log', function(msg) {
adapter.log(msg);
}).on('end', function(msg) {
progressIndicator.endTask("bower install");
vscode.window.showInformationMessage('bower install completed!');
}).on('prompt', function(prompts, callback) {
adapter.prompt(prompts, callback);
});
}