File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 1
1
NAME =entrykit
2
2
ARCH =$(shell uname -m)
3
3
ORG =progrium
4
- VERSION =0.2.1
4
+ VERSION =0.3.0
5
5
6
6
.PHONY : build release
7
7
Original file line number Diff line number Diff line change @@ -3,8 +3,10 @@ package render
3
3
import (
4
4
"io/ioutil"
5
5
6
- "github.com/mgood/go-posix "
6
+ "github.com/gliderlabs/sigil "
7
7
"github.com/progrium/entrykit"
8
+
9
+ _ "github.com/gliderlabs/sigil/builtin"
8
10
)
9
11
10
12
func init () {
@@ -13,18 +15,18 @@ func init() {
13
15
14
16
func Run (config * entrykit.Config ) {
15
17
defer entrykit .Exec (config .Exec )
16
- for _ , target := range config .Tasks {
18
+ for name , target := range config .Tasks {
17
19
template := target + ".tmpl"
18
20
data , err := ioutil .ReadFile (template )
19
21
if err != nil {
20
22
entrykit .Error (err )
21
23
}
22
- render , err := posix . ExpandEnv ( string ( data ) )
24
+ render , err := sigil . Execute ( data , nil , name )
23
25
if err != nil {
24
26
entrykit .Error (err )
25
27
}
26
28
// todo: use same filemode as template
27
- err = ioutil .WriteFile (target , [] byte ( render ), 0644 )
29
+ err = ioutil .WriteFile (target , render . Bytes ( ), 0644 )
28
30
if err != nil {
29
31
entrykit .Error (err )
30
32
}
You can’t perform that action at this time.
0 commit comments