-
Notifications
You must be signed in to change notification settings - Fork 0
Feat: Support Explicit File Paths Beyond .env conventions #17
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
27fcdf7
feat: support explicit template-file-path / output-file-path
sean-dickinson 6e16e67
style: drop alignment spacing flagged by standardrb
sean-dickinson 8ec5e7f
feat: updates
sean-dickinson ebfc6d8
build(deps): bump minitest from 6.0.2 to 6.0.6 (#16)
dependabot[bot] 252d689
build(deps): bump rake from 13.3.1 to 13.4.2 (#14)
dependabot[bot] a26b4e7
build(deps): bump standard from 1.36.0 to 1.54.0 (#11)
dependabot[bot] 4b60317
fix: simplify
sean-dickinson b43a66b
fix: add platform for ci
sean-dickinson fce3e8e
feat: support explicit template-file-path / output-file-path
sean-dickinson 058bd49
style: drop alignment spacing flagged by standardrb
sean-dickinson c451683
feat: updates
sean-dickinson cfe293d
fix: simplify
sean-dickinson 0244d96
fix: add platform for ci
sean-dickinson 7a4bc72
chore: lint
sean-dickinson 1a2f579
Merge branch 'feat/explicit-template-output-paths' of https://github.…
sean-dickinson 0ad6b3e
fix: correct readme
sean-dickinson 3ca8eed
Potential fix for pull request finding
sean-dickinson c412fca
fix: address empty string issue
sean-dickinson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,15 @@ | ||
| #!/usr/bin/env ruby | ||
| require_relative '../lib/replacer' | ||
| require "optparse" | ||
| require_relative "../lib/replacer" | ||
|
|
||
| # Example usage: | ||
| # ruby replacer.rb .env staging | ||
| # Note that we are expecting to find a .env.staging file for this example and will end up creating a new file with the replaced tokens called .env | ||
| def coerce_empty_string_to_nil(value) = value.empty? ? nil : value | ||
|
|
||
| Replacer.from_args(ARGV).replace | ||
| options = { | ||
| environment: ENV.fetch("ENVIRONMENT_NAME"), | ||
| output_file: ENV.fetch("ENV_FILE_PATH"), | ||
| template_path: coerce_empty_string_to_nil(ENV["TEMPLATE_FILE_PATH"]), | ||
| delete_template: ENV.fetch("DELETE_TEMPLATE", "true") == "true" | ||
| } | ||
|
|
||
|
|
||
| Replacer.from(**options).replace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.