angular / angular/angular-cli

Incorrect use of --directory param

Offen
#19,496 1 Kommentar 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area: @schematics/angular freq1: low severity3: broken type: bug/fix
Vorherrschende Sprache
TypeScript
Sterne
27k
Forks
11.8k
Ø Merge
14 Std. 23 Min.
Gemergte PRs (30 T.)
162

Beschreibung

# 🐞 Bug report

### Command (mark with an `x`)

- [x] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] extract-i18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

### Is this a regression?

No, this issue has been in the CLI for a long time

### Description

When using the `--directory` param with the absolute path, the CLI does not respect the value and creates the directory path relative to the current directory instead.

## 🔬 Minimal Reproduction

Run the following command:

```shell
ng new app1 --directory=/tmp/app1 --skip-install
```

Expected behaviour:

The application is generated within `/tmp/app1` directory.

Actual behaviour:

The application is generated within current directory: `./tmp/app1`

## 🌍 Your Environment

Angular CLI: 11.0.2
Node: 14.15.0
OS: darwin x64

Angular:
...
Ivy Workspace:

Package Version
------------------------------------------------------
@angular-devkit/architect 0.1100.2 (cli-only)
@angular-devkit/core 11.0.2 (cli-only)
@angular-devkit/schematics 11.0.2 (cli-only)
@schematics/angular 11.0.2 (cli-only)
@schematics/update 0.1100.2 (cli-only)

**Anything else relevant?**

Using macOS

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, `ng new app1 --directory=/tmp/app1 --skip-install` mit der gemeldeten Angular CLI-Version zu reproduzieren, und verfolge anschließend den CLI-Einstiegspunkt, der `new` und dessen Option `--directory` verarbeitet. Als erledigt gilt die Aufgabe, wenn ein absolutes Verzeichnis unter `/tmp/app1` erstellt wird und nicht unter `./tmp/app1`, ohne dass relative Pfade beeinträchtigt werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, typescript
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.