Skip to content

Commit

Permalink
Suggested code changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Namito Yokota authored and 3cp committed Apr 24, 2024
1 parent 4c0b34e commit 1cc9af7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 15 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ dist
/coverage
/package-lock.json
/yarn.lock
.npmrc
/my-app
.npmrc
4 changes: 0 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
## [3.0.3](https://github.com/aurelia/cli/compare/v3.0.2...v3.0.3) (2024-04-17)



## [3.0.2](https://github.com/aurelia/cli/compare/v3.0.1...v3.0.2) (2023-10-07)


Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +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`
6. Link the cli with: `npm link`
7. Create a new project with `au new` or use an existing project. The linked CLI will be used to create the project.
8. 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

Expand Down
8 changes: 3 additions & 5 deletions lib/package-managers/base-package-manager.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const {spawn} = require('child_process');
const npmWhich = require('npm-which');
const isWindows = process.platform === "win32";

exports.BasePackageManager = class {
constructor(executableName) {
Expand All @@ -11,19 +12,16 @@ exports.BasePackageManager = class {
}

run(command, args = [], workingDirectory = process.cwd()) {
const isWindows = process.platform === "win32";
let executable = this.getExecutablePath(workingDirectory);
let options = { stdio: "inherit", cwd: workingDirectory };
if (isWindows) {
executable = `"${executable}"`
options = { ...options, shell: true }
executable = JSON.stringify(executable); // Add quotes around path
}

return new Promise((resolve, reject) => {
this.proc = spawn(
executable,
[command, ...args],
options
{ stdio: "inherit", cwd: workingDirectory, shell: isWindows }
)
.on('close', resolve)
.on('error', reject);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-cli",
"version": "3.0.3",
"version": "3.0.2",
"description": "The command line tooling for Aurelia.",
"keywords": [
"aurelia",
Expand Down

0 comments on commit 1cc9af7

Please sign in to comment.