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

-dir flag not being respected #5867

Closed
berwyn opened this issue Apr 6, 2017 · 5 comments
Closed

-dir flag not being respected #5867

berwyn opened this issue Apr 6, 2017 · 5 comments
Labels
effort1: easy (hours) P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity2: inconvenient type: bug/fix

Comments

@berwyn
Copy link

berwyn commented Apr 6, 2017

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.0.0
node: 7.7.1
os: win32 x64 (Windows 10 1703 Build 15063.14 "Creators Update" RC)
@angular/common: 4.0.1
@angular/compiler: 4.0.1
@angular/core: 4.0.1
@angular/flex-layout: 2.0.0-beta.7
@angular/http: 4.0.1
@angular/material: 2.0.0-beta.2
@angular/platform-browser: 4.0.1
@angular/platform-browser-dynamic: 4.0.1

Repro steps.

  1. run ng new -dir foo myapp
  2. Notice how the app is created in cwd, not in ./foo

The log given by the failure.

Correct output for app generation

Desired functionality.

The app should be created in ./foo, as indicated in the help text:

--directory (String) The directory name to create the app in.
  aliases: -dir <value>, --directory <value>

Mention any other details that might be useful.

@berwyn berwyn changed the title --dir flag not being respected -dir flag not being respected Apr 6, 2017
@delasteve
Copy link
Contributor

I was unable to reproduce this using

@angular/cli: 1.0.1
node: 7.9.0
os: win32 x64

Using ng new -dir foo someapp, when I lsed the parent directory, I got

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        4/27/2017  11:58 AM                foo

@berwyn
Copy link
Author

berwyn commented Apr 27, 2017

My apologies, I debugged it more and found that the issue required more specific conditions to dupe and forgot to update this bug report. This is specifically if a directory above contains a package.json file. In my case, I was building a group of modules with lerna, where one was an Angular app. Angular CLI 1.0.0 would create the app at the top-level next to package.json rather than in the directory specified by -dir. I have not attempted with 1.0.1 yet, so this may be fixed (I'll report back when I have a chance to test)

In other words, my expected setup was

ng new -dir packages/foo-app foo

resulting in

./
|- package.json # Top level
|- lerna.json
`- packages
   `- foo-app
     |- .angular-cli.json
     |- karma.conf.js
     ...

but instead I got

./
|- package.json
|- lerna.json
|- .angular-cli.json
|- karma.conf.js
...

@filipesilva
Copy link
Contributor

I actually thought we fixed this already in #4901. Maybe something is broken.

@filipesilva filipesilva added effort1: easy (hours) P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity2: inconvenient type: bug/fix labels May 4, 2017
@hansl
Copy link
Contributor

hansl commented Jan 14, 2019

This has been fixed a long time ago, never marked. If this still happens please create a new issue so we can follow up.

@hansl hansl closed this as completed Jan 14, 2019
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
effort1: easy (hours) P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity2: inconvenient type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants