Add shellscript filenamePatterns for .env.*#173426
Add shellscript filenamePatterns for .env.*#173426alexr00 merged 2 commits intomicrosoft:mainfrom thernstig:main
filenamePatterns for .env.*#173426Conversation
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
|
@thernstig can you share several examples of these |
|
@alexr00 An example would be two different deployments like this, where clients have different databases because an application supports multiple: .env.production_site_1export MONGODB_ENABLED=true
export POSTGRES_ENABLED=false.env.production_site_2export MONGODB_ENABLED=false
export POSTGRES_ENABLED=trueThey 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 |
alexr00
left a comment
There was a problem hiding this comment.
Thank you for the details. Just one more question.
filenamePatterns for .env*filenamePatterns for .env.*
* 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.*
In some cases, projects use
.envfiles such as.env.developmentor.env.productionor similar things.Adding this to extensions/shellscript/package.json as a
filenamePatternsavoids developers having to add specific"files.associations"to their VS Code settings files.Fixes #173425