Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed broken au run command for Windows #1206

Merged
merged 9 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ dist
/package-lock.json
/yarn.lock
.npmrc
/my-app
3cp marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [3.0.3](https://github.com/aurelia/cli/compare/v3.0.2...v3.0.3) (2024-04-17)
3cp marked this conversation as resolved.
Show resolved Hide resolved



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


Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
6. Link the cli with: `npm link`
3cp marked this conversation as resolved.
Show resolved Hide resolved
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`

## Running the Tests

Expand Down
12 changes: 10 additions & 2 deletions lib/package-managers/base-package-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,19 @@ exports.BasePackageManager = class {
}

run(command, args = [], workingDirectory = process.cwd()) {
const isWindows = process.platform === "win32";
3cp marked this conversation as resolved.
Show resolved Hide resolved
let executable = this.getExecutablePath(workingDirectory);
let options = { stdio: "inherit", cwd: workingDirectory };
if (isWindows) {
executable = `"${executable}"`
3cp marked this conversation as resolved.
Show resolved Hide resolved
options = { ...options, shell: true }
3cp marked this conversation as resolved.
Show resolved Hide resolved
}

return new Promise((resolve, reject) => {
this.proc = spawn(
this.getExecutablePath(workingDirectory),
executable,
[command, ...args],
{ stdio: 'inherit', cwd: workingDirectory }
options
)
.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.2",
"version": "3.0.3",
3cp marked this conversation as resolved.
Show resolved Hide resolved
"description": "The command line tooling for Aurelia.",
"keywords": [
"aurelia",
Expand Down
Loading