Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
kilgaloon committed Jun 20, 2018
2 parents 2b82d63 + e3e50bc commit fbb75da
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Go Report Card](https://goreportcard.com/badge/github.com/Kilgaloon/Leprechaun)](https://goreportcard.com/report/github.com/Kilgaloon/Leprechaun)

Current Version: **0.4.0** <br />
Current Version: **0.5.0** <br />
Current Release: **Calimero**

**Leprechaun** is tool where you can schedule your recurring tasks to be performed over and over.
Expand Down
2 changes: 1 addition & 1 deletion bin/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

// VERSION of application
const (
VERSION = "0.4.0"
VERSION = "0.5.0"
RELEASE = "Calimero"
)

Expand Down
7 changes: 7 additions & 0 deletions src/client/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package client
import (
"../log"
"gopkg.in/ini.v1"
"os"
"strings"
)

// Config values
Expand All @@ -27,6 +29,11 @@ func readConfig(path string) *Config {
for _, variable := range variables {
CurrentContext.DefineVar(variable.Name(), variable.String())
}
// insert environment variables in our context
for _, e := range os.Environ() {
pair := strings.Split(e, "=")
CurrentContext.DefineVar(pair[0], pair[1])
}

log.Logger.ErrorLog = c.errorLog
log.Logger.InfoLog = c.infoLog
Expand Down
6 changes: 2 additions & 4 deletions src/client/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,11 @@ func (c *Context) GetVar(name string) Variable {

// Transpile text change variables from context
func (c *Context) Transpile(toCompile string) string {
var str string

for _, variable := range c.variables {
str = strings.Replace(toCompile, "$"+variable.name, variable.value, -1)
toCompile = strings.Replace(toCompile, "$"+variable.name, variable.value, -1)
}

return str
return toCompile
}

// CurrentContext of client
Expand Down

0 comments on commit fbb75da

Please sign in to comment.