示例#1
0
        private async Task <bool> InstallTypingsTool()
        {
            _didTryToInstallTypingsTool = true;

            Directory.CreateDirectory(NtvsExternalToolsPath);

            // install typings
            using (var commander = _npmController.CreateNpmCommander()) {
                return(await commander.InstallPackageToFolderByVersionAsync(NtvsExternalToolsPath, TypingsTool, TypingsToolVersion, false));
            }
        }
        private async Task <bool> InstallTypingsTool()
        {
            _didTryToInstallTypingsTool = true;

            Directory.CreateDirectory(NodejsConstants.ExternalToolsPath);

            // install typings
            using (var commander = _npmController.CreateNpmCommander()) {
                return(await commander.InstallPackageToFolderByVersionAsync(
                           NodejsConstants.ExternalToolsPath,
                           string.Format(CultureInfo.InvariantCulture, @"""{0}""", LocalTypingsToolPath),
                           string.Empty,
                           false));
            }
        }
        private void InstallPackage(string package)
        {
            var    packageInfo    = package.Split('@');
            string packageName    = packageInfo[0];
            string packageVersion = "*";

            if (packageInfo.Length > 1)
            {
                packageVersion = packageInfo[1];
            }
            var task = _npmController.CreateNpmCommander().InstallPackageByVersionAsync(
                packageName,
                packageVersion,
                _depType,
                true
                );

            task.Wait();
            if (!task.Result)
            {
                Console.WriteLine("Failed to install package {0}", package);
                Assert.Fail("Failed to install package {0}", package);
            }
        }
示例#4
0
 private async Task <bool> TryInstallTsd()
 {
     using (var commander = _npmController.CreateNpmCommander()) {
         return(await commander.InstallGlobalPackageByVersionAsync(Tsd, "*"));
     }
 }