Skip to content

Commit

Permalink
add example of http fetch to README
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasepe committed May 21, 2021
1 parent db0b429 commit 897d4d7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,26 @@ Example:
$ tbd -vars testdata/sample1.vars testdata/sample1.yml.tbd
```

> 👉 you can also specify an HTTP url to fetch your template and/or placeholders values.
👉 you can also specify an HTTP url to fetch your template and/or placeholders values.

Example:

```sh
$ tbd -vars https://raw.githubusercontent.com/lucasepe/tbd/main/testdata/sample2.vars \
https://raw.githubusercontent.com/lucasepe/tbd/main/testdata/sample2.txt.tbd
```

and the output is...

```txt
Greetings
I will be out of the office from August, 9 until August 23.
If you need immediate assistance while I’m away, please email [email protected].
Best,
Pinco Pallo
```

## How to list all template placeholders?

Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module github.com/lucasepe/tbd

go 1.16

require github.com/google/go-cmp v0.5.5
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

0 comments on commit 897d4d7

Please sign in to comment.