docs: update README.md
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
ae9192f12f
commit
4e48824fc0
|
@ -0,0 +1,19 @@
|
|||
Copyright © 2023 Rob Watson.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the “Software”), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
50
README.md
50
README.md
|
@ -1,15 +1,22 @@
|
|||
# envfilesubst
|
||||
|
||||
envfilesubst is a variation of gettext's envsubst, with a different modus
|
||||
operandi.
|
||||
envfilesubst is a variation of gettext's
|
||||
[envsubst](https://www.gnu.org/software/gettext/manual/html_node/envsubst-Invocation.html),
|
||||
with a different modus operandi.
|
||||
|
||||
Firstly, instead of reading the current environment, it instead parses a file
|
||||
in "envfile" format.
|
||||
Firstly, instead of reading the current environment it reads from file in
|
||||
traditional "envfile" format.
|
||||
|
||||
Secondly, it will read from standard input and replace all variable references
|
||||
that can be found in the envfile. If variables are not explicitly mentioned in
|
||||
the envfile, the references will be left intact (instead of replacing them with
|
||||
an empty string).
|
||||
Secondly, it will read input from stdin replacing all variable references that
|
||||
can be matched with the envfile. If variables are not explicitly mentioned in
|
||||
the envfile, the references will be left untouched (instead of replacing them
|
||||
with an empty string).
|
||||
|
||||
## Git
|
||||
|
||||
The main git repo is: https://git.netflux.io/rob/envfilesubst
|
||||
|
||||
It is also mirrored on GitHub: https://github.com/rfwatson/envfilesubst
|
||||
|
||||
## Installation
|
||||
|
||||
|
@ -22,6 +29,7 @@ go install git.netflux.io/rob/envfilesubst@latest
|
|||
Given an envfile:
|
||||
|
||||
```
|
||||
# myenvfile
|
||||
FOO=bar
|
||||
X=1
|
||||
```
|
||||
|
@ -29,33 +37,11 @@ X=1
|
|||
Then:
|
||||
|
||||
```
|
||||
echo "FOO is $FOO and X is ${X}. I don't know $BAR." | envfilesubst -f myenvfile
|
||||
echo "FOO is $FOO and X is ${X}. I don't know $BAZ." | envfilesubst -f myenvfile
|
||||
```
|
||||
|
||||
The output is:
|
||||
|
||||
```
|
||||
FOO is bar and X is 1. I don't know $BAR.
|
||||
FOO is bar and X is 1. I don't know $BAZ.
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2022 Rob Watson.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the “Software”), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
|
Loading…
Reference in New Issue