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

Add shellscript filenamePatterns for .env.* #173426

Merged
merged 2 commits into from Feb 10, 2023
Merged

Add shellscript filenamePatterns for .env.* #173426

merged 2 commits into from Feb 10, 2023

Conversation

thernstig
Copy link
Contributor

In some cases, projects use .env files such as .env.development or .env.production or similar things.

Adding this to extensions/shellscript/package.json as a filenamePatterns avoids developers having to add specific "files.associations" to their VS Code settings files.

Fixes #173425

In some cases, projects use `.env` files such as `.env.development`
or `.env.production` or similar things.

Adding this to extensions/shellscript/package.json as a
`filenamePatterns` avoids developers having to add specific
`"files.associations"` to their VS Code settings files.

Fixes #173425
@alexr00
Copy link
Member

alexr00 commented Feb 6, 2023

@thernstig can you share several examples of these .env files? I found https://github.com/facebook/create-react-app/blob/d960b9e38c062584ff6cfb1a70e1512509a966e7/packages/react-scripts/fixtures/kitchensink/template/.env.development and that looks more like a properties file then a shellscript file.

@thernstig
Copy link
Contributor Author

thernstig commented Feb 6, 2023

@alexr00 An example would be two different deployments like this, where clients have different databases because an application supports multiple:

.env.production_site_1

export MONGODB_ENABLED=true
export POSTGRES_ENABLED=false

.env.production_site_2

export MONGODB_ENABLED=false
export POSTGRES_ENABLED=true

They could use it in the context of https://direnv.net/ (or similar tools) to load it per environment, setting per-environment config according to The Twelve-Factor App (https://12factor.net/config more specifically).

The example from create-react-app are shell files, see https://github.com/facebook/create-react-app/blob/d960b9e38c062584ff6cfb1a70e1512509a966e7/packages/react-scripts/fixtures/kitchensink/template/.env (where one can see ${REACT_APP_BASIC}, https://github.com/facebook/create-react-app/blob/d960b9e38c062584ff6cfb1a70e1512509a966e7/packages/react-scripts/fixtures/kitchensink/template/.env.development etc.

Copy link
Member

@alexr00 alexr00 left a comment

Choose a reason for hiding this comment

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

Thank you for the details. Just one more question.

extensions/shellscript/package.json Outdated Show resolved Hide resolved
@thernstig thernstig changed the title Add shellscript filenamePatterns for .env* Add shellscript filenamePatterns for .env.* Feb 7, 2023
@alexr00 alexr00 added this to the February 2023 milestone Feb 10, 2023
Copy link
Member

@alexr00 alexr00 left a comment

Choose a reason for hiding this comment

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

Thank you for the change!

@alexr00 alexr00 enabled auto-merge (squash) February 10, 2023 14:10
@alexr00 alexr00 merged commit c612c5d into microsoft:main Feb 10, 2023
c-claeys pushed a commit to c-claeys/vscode that referenced this pull request Feb 16, 2023
* Add shellscript `filenamePatterns` for `.env*`

In some cases, projects use `.env` files such as `.env.development`
or `.env.production` or similar things.

Adding this to extensions/shellscript/package.json as a
`filenamePatterns` avoids developers having to add specific
`"files.associations"` to their VS Code settings files.

Fixes microsoft#173425

* Change pattern from .env* to .env.*
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add shellscript filenamePatterns for .env*
5 participants