當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript run-in-terminal.runInTerminal函數代碼示例

本文整理匯總了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
							}
						});
					}
				});
			});
開發者ID:DanielMeixner,項目名稱:omnisharp-vscode,代碼行數:29,代碼來源:commands.ts

示例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}.`);
	});
開發者ID:Jeffiy,項目名稱:omnisharp-vscode,代碼行數:13,代碼來源:commands.ts

示例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}.`)
	});
開發者ID:DanielMeixner,項目名稱:omnisharp-vscode,代碼行數:16,代碼來源:commands.ts

示例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();
			}
		});
	});
開發者ID:Jeffiy,項目名稱:omnisharp-vscode,代碼行數:24,代碼來源:commands.ts

示例5: runCommandInTerminal

function runCommandInTerminal(args: string[], cwd: string): void {
	runInTerminal('npm', args, { cwd: cwd, env: process.env });
}
開發者ID:Gigitsu,項目名稱:vscode-npm-scripts,代碼行數:3,代碼來源:main.ts

示例6: runInTerminal

 }).then((solutionDirectory) => {
     return runInTerminal('dotnet', ['restore'], {
         cwd: solutionPathOrFolder
     });
 });
開發者ID:ERRLSTAR,項目名稱:omnisharp-vscode,代碼行數:5,代碼來源:commands.ts


注:本文中的run-in-terminal.runInTerminal函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。