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

copy .env.template to .env if it exists #458

Merged
merged 1 commit into from
Apr 6, 2021
Merged
Changes from all 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
3 changes: 3 additions & 0 deletions packages/cli/commands/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ exports.handler = async options => {
}
);
if (created) {
if (fs.existsSync(`${filePath}/.env.template`)) {
fs.copySync(`${filePath}/.env.template`, `${filePath}/.env`);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing that I am not sure I understand is why the boilerplates should not be adjusted to have .env.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @gcorne, adjusting .env to the boilerplates is a good idea, but we have some concerns about excluding it from .gitignore since:

  • it needs to be gitignored during our development
  • user will most likely add it to .gitignore again

So, wondering, how do you see adjusting .env to the boilerplates?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I see why using a template was chosen. I think copying from a template is okay, although I wonder if moving the file would be better.

logger.success(
`Please, follow ${filePath}/README.md to find out how to run the sample`
);
Expand Down