From 1cc9af7de77936f3df7f634cfc103008ebc51359 Mon Sep 17 00:00:00 2001 From: Namito Yokota Date: Tue, 23 Apr 2024 07:18:46 -0500 Subject: [PATCH] Suggested code changes. --- .gitignore | 3 +-- CHANGELOG.md | 4 ---- README.md | 6 +++--- lib/package-managers/base-package-manager.js | 8 +++----- package.json | 2 +- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index c54fda6e..b0d04eb9 100644 --- a/.gitignore +++ b/.gitignore @@ -11,5 +11,4 @@ dist /coverage /package-lock.json /yarn.lock -.npmrc -/my-app \ No newline at end of file +.npmrc \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index afc92759..69280e9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/README.md b/README.md index 2dd97c43..4597d461 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/lib/package-managers/base-package-manager.js b/lib/package-managers/base-package-manager.js index 48b749b1..673a9453 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,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); diff --git a/package.json b/package.json index 860bcde6..fce0b14f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-cli", - "version": "3.0.3", + "version": "3.0.2", "description": "The command line tooling for Aurelia.", "keywords": [ "aurelia",