diff --git a/.gitignore b/.gitignore index 5d9c4dfe2..b0d04eb99 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,4 @@ dist /coverage /package-lock.json /yarn.lock -.npmrc +.npmrc \ No newline at end of file diff --git a/README.md b/README.md index e1c098a91..4597d461e 100644 --- a/README.md +++ b/README.md @@ -27,10 +27,9 @@ The `au new` command now simplify wraps `npx makes aurelia/v1`. Users can direct 1. Clone the aurelia-cli: `git clone https://github.com/aurelia/cli.git` 2. Go into the cli directory: `cd cli` 3. Run `npm install` -4. Run build `npm run build` -5. Link the cli with: `npm link` -6. Create a new project with `au new` or use an existing project. The linked CLI will be used to create the project. -7. In the project directory, run `npm link aurelia-cli`. The linked CLI will then be used for `au` commands such as `au run` +4. Link the cli with: `npm link` +5. Create a new project with `au new` or use an existing project. The linked CLI will be used to create the project. +6. In the project directory, run `npm link aurelia-cli`. The linked CLI will then be used for `au` commands such as `au run` ## Running the Tests diff --git a/lib/package-managers/base-package-manager.js b/lib/package-managers/base-package-manager.js index fc66ab193..673a94532 100644 --- a/lib/package-managers/base-package-manager.js +++ b/lib/package-managers/base-package-manager.js @@ -1,5 +1,6 @@ const {spawn} = require('child_process'); const npmWhich = require('npm-which'); +const isWindows = process.platform === "win32"; exports.BasePackageManager = class { constructor(executableName) { @@ -11,11 +12,16 @@ exports.BasePackageManager = class { } run(command, args = [], workingDirectory = process.cwd()) { + let executable = this.getExecutablePath(workingDirectory); + if (isWindows) { + executable = JSON.stringify(executable); // Add quotes around path + } + return new Promise((resolve, reject) => { this.proc = spawn( - this.getExecutablePath(workingDirectory), + executable, [command, ...args], - { stdio: 'inherit', cwd: workingDirectory } + { stdio: "inherit", cwd: workingDirectory, shell: isWindows } ) .on('close', resolve) .on('error', reject);