Skip to content

Add shellscript filenamePatterns for .env.* - #173426

Merged
Alex Ross (alexr00) merged 2 commits into
microsoft:mainfrom
thernstig:main
Feb 10, 2023
Merged

Add shellscript filenamePatterns for .env.*#173426
Alex Ross (alexr00) merged 2 commits into
microsoft:mainfrom
thernstig:main

Conversation

@thernstig

Copy link
Copy Markdown
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
Copy Markdown
Member

@thernstig

Tobias Hernstig (thernstig) commented Feb 6, 2023

Copy link
Copy Markdown
Contributor Author

Alex Ross (@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.

@alexr00 Alex Ross (alexr00) left a comment

Copy link
Copy Markdown
Member

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.

Comment thread extensions/shellscript/package.json Outdated
@thernstig Tobias Hernstig (thernstig) changed the title Add shellscript filenamePatterns for .env* Add shellscript filenamePatterns for .env.* Feb 7, 2023
@alexr00 Alex Ross (alexr00) added this to the February 2023 milestone Feb 10, 2023

@alexr00 Alex Ross (alexr00) left a comment

Copy link
Copy Markdown
Member

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
Alex Ross (alexr00) enabled auto-merge (squash) February 10, 2023 14:10
@alexr00
Alex Ross (alexr00) merged commit c612c5d into microsoft:main Feb 10, 2023
Cristopher Claeys (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