Skip to content

Commit

Permalink
fixes #35 Error adding feature project due to spaces in the path of t…
Browse files Browse the repository at this point in the history
…he module
  • Loading branch information
TakeitEasyAlan committed Feb 8, 2017
1 parent 43e7e74 commit 582441b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Modules/Powershell.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function Powershell () {
Powershell.prototype.runAsync = function (pathToScriptFile, parameters) {
console.log("Powershell - running: " + pathToScriptFile + " " + parameters);
var spawn = require("child_process").spawn;
var child = spawn("powershell.exe", [pathToScriptFile, parameters]);
var child = spawn("powershell.exe", [pathToScriptFile.replace(/ /g,'` '), parameters]);

child.stdout.setEncoding('utf8');
child.stderr.setEncoding('utf8');
Expand All @@ -28,4 +28,4 @@ Powershell.prototype.runAsync = function (pathToScriptFile, parameters) {
child.stdin.end();
}

exports = module.exports = new Powershell();
exports = module.exports = new Powershell();
4 changes: 3 additions & 1 deletion generators/add/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ module.exports = class extends yeoman {
const SolutionFile = files.find(file => file.indexOf('.sln') > -1)
const scriptParameters = "-SolutionFile '" + this.destinationPath(SolutionFile) + "' -Name " + this.settings.LayerPrefixedProjectName + " -Type " + this.layer + " -ProjectPath '" + this.settings.ProjectPath + "'" + " -SolutionFolderName " + this.templatedata.projectname;

powershell.runAsync(path.join(this._sourceRoot, "../../../powershell/add-project.ps1"), scriptParameters)
var pathToAddProjectScript = path.join(this._sourceRoot, "../../../powershell/add-project.ps1");
powershell.runAsync(pathToAddProjectScript, scriptParameters);

}
};

0 comments on commit 582441b

Please sign in to comment.