Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seferov/composer-env-script
Composer script for handling gitignored env files
https://github.com/seferov/composer-env-script
composer dotenv
Last synced: 1 day ago
JSON representation
Composer script for handling gitignored env files
- Host: GitHub
- URL: https://github.com/seferov/composer-env-script
- Owner: seferov
- Created: 2022-09-29T10:43:27.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-01T20:22:11.000Z (over 2 years ago)
- Last Synced: 2024-03-14T17:32:21.209Z (11 months ago)
- Topics: composer, dotenv
- Language: PHP
- Homepage:
- Size: 492 KB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Composer Env File Script
The package allows creating or updating ignored env file (ex: `.env.local`) based on
a default env file (ex: `.env`) interactively.![demo](assets/demo.gif)
----
### Installation
```shell
composer require seferov/composer-env-script
```Modify your `composer.json` file:
```json
{
"scripts": {
"post-install-cmd": [
"Seferov\\ComposerEnvScript\\ScriptHandler::buildEnv"
],
"post-update-cmd": [
"Seferov\\ComposerEnvScript\\ScriptHandler::buildEnv"
]
}
}
```### Configuration
By default, the package generates/updates `.env.local` file based on `.env`. This can be
changed trough composer.json extra. The configuration also allows managing multiple .env files:```json
{
"extra": {
"seferov-env": [
{
"from-file": ".env",
"to-file": ".env.local"
},
{
"from-file": "somepath/.env.test",
"to-file": "somepath/.env.test.local"
}
]
}
}
```### Credits
The package is highly inspired by https://github.com/Incenteev/ParameterHandler which is for
managing ignored parameters.