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

When creating a new project from within the target folder with a target of "." or "./" don't set target to process.cwd() because that doesn't work. #98

Closed
jeffschwartz opened this issue Jan 18, 2020 · 0 comments
Assignees
Labels
bug Something isn't working cli related Issue is cli related terminal output related Issue is terminal output related
Milestone

Comments

@jeffschwartz
Copy link
Contributor

jeffschwartz commented Jan 18, 2020

Problem:

The code to generate a new project interprets target prior to using it in file I/O calls as follows:

target = target === "." && process.cwd() || target;

which causes the project to be generated in the wrong target folder if the user enters "." as the target.

Not sure about other operating systems, but on Mac Os the system will interpret this as current directory/full path to current directory when making IO calls to create directories.

Solution:

Leave target set to whatever the user had entered and use path.resolve(target) for console.log output when reporting to the console.

@jeffschwartz jeffschwartz self-assigned this Jan 18, 2020
@jeffschwartz jeffschwartz added bug Something isn't working cli related Issue is cli related terminal output related Issue is terminal output related labels Jan 18, 2020
@jeffschwartz jeffschwartz added this to the v3.0.0 milestone Jan 18, 2020
jeffschwartz added a commit that referenced this issue Jan 18, 2020
process.cwd() when user submitted "." as the target
for creating a new project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli related Issue is cli related terminal output related Issue is terminal output related
Projects
None yet
Development

No branches or pull requests

1 participant