本文整理匯總了TypeScript中run-in-terminal.runInTerminal函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript runInTerminal函數的具體用法?TypeScript runInTerminal怎麽用?TypeScript runInTerminal使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了runInTerminal函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: basename
Object.keys(project.Commands).forEach(key => {
commands.push({
label: `dnx ${key} - (${project.Name || basename(project.Path)})`,
description: dirname(project.Path),
execute() {
lastCommand = this;
let command = join(info.Dnx.RuntimePath, 'bin/dnx');
let args = [key];
// dnx-beta[1-6] needs a leading dot, like 'dnx . run'
if (/-beta[1-6]/.test(info.Dnx.RuntimePath)) {
args.unshift('.');
}
if (isWin) {
command += '.exe';
}
return runInTerminal(command, args, {
cwd: dirname(project.Path),
env: {
// KRE_COMPILATION_SERVER_PORT: workspace.DesignTimeHostPort
}
});
}
});
});
示例2: runInTerminal
return serverUtils.requestWorkspaceInformation(server).then(info => {
if ('DotNet' in info && info.DotNet.Projects.length > 0) {
for (let project of info.DotNet.Projects) {
if (project.Path === path.dirname(fileName)) {
return runInTerminal('dotnet', ['restore', fileName], {
cwd: path.dirname(project.Path)
});
}
}
}
return Promise.reject(`Failed to execute restore, try to run 'dotnet restore' manually for ${fileName}.`);
});
示例3: join
return server.makeRequest<proto.WorkspaceInformationResponse>(proto.Projects).then((info):Promise<any> => {
for(let project of info.Dnx.Projects) {
if (project.Path === fileName) {
let command = join(info.Dnx.RuntimePath, 'bin/dnu');
if (isWin) {
command += '.cmd';
}
return runInTerminal(command, ['restore'], {
cwd: dirname(project.Path)
});
}
}
return Promise.reject(`Failed to execute restore, try to run 'dnu restore' manually for ${fileName}.`)
});
示例4: execute
return serverUtils.requestWorkspaceInformation(server).then(info => {
let commands: Command[] = [];
if ('DotNet' in info && info.DotNet.Projects.length > 0) {
for (let project of info.DotNet.Projects) {
commands.push({
label: `dotnet restor - (${project.Name || path.basename(project.Path)})`,
description: path.dirname(project.Path),
execute() {
return runInTerminal('dotnet', ['restore'], {
cwd: path.dirname(project.Path)
});
}
});
}
}
return vscode.window.showQuickPick(commands).then(command => {
if (command) {
return command.execute();
}
});
});
示例5: runCommandInTerminal
function runCommandInTerminal(args: string[], cwd: string): void {
runInTerminal('npm', args, { cwd: cwd, env: process.env });
}
示例6: runInTerminal
}).then((solutionDirectory) => {
return runInTerminal('dotnet', ['restore'], {
cwd: solutionPathOrFolder
});
});