feat: add environment variables when installing#1239
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds automatic environment variable configuration during package installation. When installing framework packages (session, route, mail, log, grpc, database), the setup scripts now append required environment variables to .env and .env.example files if they don't already exist.
Key changes:
- Adds
Appendmethod to theFileinterface for appending content to files - Introduces
WhenFileContainsandWhenFileNotContainsconditional modifiers - Updates all package setup scripts to append environment variables during installation
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| contracts/packages/modify/modify.go | Adds Append method to File interface |
| packages/modify/modify.go | Implements Append, WhenFileContains, and WhenFileNotContains functions with debug logging |
| packages/modify/modify_test.go | Adds test coverage for new conditional modifiers |
| session/setup/setup.go | Adds session environment variables during installation |
| route/setup/setup.go | Adds route environment variables during installation |
| mail/setup/setup.go | Adds mail environment variables during installation |
| log/setup/setup.go | Adds log environment variables during installation |
| grpc/setup/setup.go | Adds grpc environment variables during installation |
| database/setup/setup.go | Adds database environment variables and refactors config content retrieval |
| errors/list.go | Adds FileNotExist error for better error handling |
| foundation/application.go | Adds newline to error messages for better formatting |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1239 +/- ##
==========================================
- Coverage 66.09% 65.73% -0.36%
==========================================
Files 248 248
Lines 17069 17185 +116
==========================================
+ Hits 11282 11297 +15
- Misses 5410 5511 +101
Partials 377 377 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
📑 Description
✅ Checks