Skip to content

Commit 4b1abdf

Browse files
committed
Update README
1 parent 99b457e commit 4b1abdf

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,16 @@ A quick introduction to Golang Templates can be found at [Hugo](https://gohugo.i
138138

139139
## How to Install
140140

141+
### `io` Command
142+
143+
``` shell
144+
go install github.com/jojomi/io/cmd/io@latest
145+
```
146+
147+
### `github.com/jojomi/io` Library
148+
141149
``` shell
142-
go install github.com/jojomi/io@latest
150+
go get -u github.com/jojomi/io
143151
```
144152

145153
## Who uses it?

docu/README.tpl.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,32 @@ These files will be inlined as described in the template. The generated comment
7373
To update the hostsfile the system will use at `/etc/hosts`, run this:
7474

7575
``` shell
76-
{{ regexReplaceAll "^#\\s*|\\s*#$" (include "docu/hosts.gen" | match "sudo io") "" }}
76+
{{ regexpReplaceLiteral "(^\\s*#\\s*)|(\\s*#\\s*$)" "" (include "docu/hosts.gen" | match "sudo io") }}
7777
```
7878

7979
Other content around the `range` operation is left untouched, but can still only be edited in `/etc/hosts.gen` otherwise it would be overwritten.
8080

8181

8282
## Template Functions
8383

84-
* all functions defined in [Masterminds/**sprig**](http://masterminds.github.io/sprig/)
85-
* all functions defined in [jojomi/**tplfuncs**](https://github.com/jojomi/tplfuncs) (the `exec*` variants are only avaiable when `--allow-exec` is given when calling `io` due to security implications)
84+
All functions defined in [jojomi/**tplfuncs**](https://github.com/jojomi/tplfuncs) (the `exec*` variants are only avaiable when `--allow-exec` is given when calling `io` due to security implications)
8685

8786
A quick introduction to Golang Templates can be found at [Hugo](https://gohugo.io/templates/introduction).
8887

8988
## How to Install
9089

90+
{{ $base := (exec "git config --get remote.origin.url" | trim | replace "git@" "" | replace "https://" "" | replace ".git" "" | replace ":" "/" ) -}}
91+
92+
### `io` Command
93+
94+
``` shell
95+
go install {{ $base }}/cmd/io@latest
96+
```
97+
98+
### `github.com/jojomi/io` Library
99+
91100
``` shell
92-
go install {{ regexReplaceAllLiteral "\\.git$" (exec "git config --get remote.origin.url" | trim | replace "git@" "" | replace "https://" "" | replace ":" "/" ) "" -}} @latest
101+
go get -u {{ $base }}
93102
```
94103

95104
## Who uses it?

0 commit comments

Comments
 (0)