Skip to content

Commit

Permalink
Wrap npmLocation if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
billti committed May 26, 2017
1 parent 47bd5af commit 47a0a7c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/server/typingsInstaller/nodeTypingsInstaller.ts
Expand Up @@ -85,6 +85,11 @@ namespace ts.server.typingsInstaller {
throttleLimit,
log);
this.npmPath = npmLocation !== undefined ? npmLocation : getDefaultNPMLocation(process.argv[0]);

// If the NPM path contains spaces and isn't wrapped in quotes, do so.
if (this.npmPath.indexOf(" ") !== -1 && this.npmPath[0] != `"`) {
this.npmPath = `"${this.npmPath}"`;
}
if (this.log.isEnabled()) {
this.log.writeLine(`Process id: ${process.pid}`);
this.log.writeLine(`NPM location: ${this.npmPath} (explicit '${Arguments.NpmLocation}' ${npmLocation === undefined ? "not " : ""} provided)`);
Expand Down Expand Up @@ -183,4 +188,4 @@ namespace ts.server.typingsInstaller {
});
const installer = new NodeTypingsInstaller(globalTypingsCacheLocation, typingSafeListLocation, npmLocation, /*throttleLimit*/5, log);
installer.listen();
}
}

0 comments on commit 47a0a7c

Please sign in to comment.