Incorrect use of --directory param

未关闭
#19,496 1 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
angular, typescript
领域
cli

调研方向

首先,使用报告中的 Angular CLI 版本重现 ng new app1 --directory=/tmp/app1 --skip-install,然后跟踪处理 new 及其 --directory 选项的 CLI 入口点。完成的标准是在 /tmp/app1 创建绝对目录,而不是创建在 ./tmp/app1,同时不影响相对路径。

由索引模型根据 Issue 内容生成。

描述

area: @schematics/angular freq1: low severity3: broken type: bug/fix

🐞 Bug report

Command (mark with an 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:

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

主要语言
TypeScript
星标
27k
派生
11.8k
平均合并
16 小时 35 分钟
30 天内合并 PR
176

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

angular/angular-cli 的其他 Issue

查看 angular/angular-cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。