Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Use Go from GOROOT while installing tools
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Nov 1, 2016
1 parent 5df5cd2 commit 28d44e7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/goInstallTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import path = require('path');
import os = require('os');
import cp = require('child_process');
import { showGoStatus, hideGoStatus } from './goStatus';
import { getBinPath } from './goPath';
import { getBinPath, getGoRuntimePath } from './goPath';
import { outputChannel } from './goStatus';
import { getGoVersion, SemVersion, isVendorSupported } from './util';

Expand Down Expand Up @@ -96,6 +96,7 @@ export function promptForUpdatingTool(tool: string) {
*/
function installTools(goVersion: SemVersion, missing?: string[]) {
let tools = getTools(goVersion);
let goRuntimePath = getGoRuntimePath();
if (!missing) {
missing = Object.keys(tools);
}
Expand All @@ -110,7 +111,7 @@ function installTools(goVersion: SemVersion, missing?: string[]) {

missing.reduce((res: Promise<string[]>, tool: string) => {
return res.then(sofar => new Promise<string[]>((resolve, reject) => {
cp.exec('go get -u -v ' + tools[tool], { env: process.env }, (err, stdout, stderr) => {
cp.execFile(goRuntimePath, ['get', '-u', '-v', tools[tool]], { env: process.env }, (err, stdout, stderr) => {
if (err) {
outputChannel.appendLine('Installing ' + tool + ' FAILED');
let failureReason = tool + ';;' + err + stdout.toString() + stderr.toString();
Expand Down

0 comments on commit 28d44e7

Please sign in to comment.