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
|
||||||
|
|
||||||
envfilesubst is a variation of gettext's envsubst, with a different modus
|
envfilesubst is a variation of gettext's
|
||||||
operandi.
|
[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
|
Firstly, instead of reading the current environment it reads from file in
|
||||||
in "envfile" format.
|
traditional "envfile" format.
|
||||||
|
|
||||||
Secondly, it will read from standard input and replace all variable references
|
Secondly, it will read input from stdin replacing all variable references that
|
||||||
that can be found in the envfile. If variables are not explicitly mentioned in
|
can be matched with the envfile. If variables are not explicitly mentioned in
|
||||||
the envfile, the references will be left intact (instead of replacing them with
|
the envfile, the references will be left untouched (instead of replacing them
|
||||||
an empty string).
|
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
|
## Installation
|
||||||
|
|
||||||
|
@ -22,6 +29,7 @@ go install git.netflux.io/rob/envfilesubst@latest
|
||||||
Given an envfile:
|
Given an envfile:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
# myenvfile
|
||||||
FOO=bar
|
FOO=bar
|
||||||
X=1
|
X=1
|
||||||
```
|
```
|
||||||
|
@ -29,33 +37,11 @@ X=1
|
||||||
Then:
|
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:
|
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