Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Strip trailing slashes from path in config

  • Loading branch information...
commit da0dad4067e29366cafccd16de72e010f265b1d0 1 parent 33714c1
@mrnugget authored
Showing with 5 additions and 1 deletion.
  1. +4 −0 config.go
  2. +1 −1  fixtures/example_config.json
View
4 config.go
@@ -29,6 +29,10 @@ func ParseConfig(path string) (rules []*Rule, err error) {
attributes := v.(map[string]interface{})
run := attributes["run"].(string)
+ for len(path) > 0 && path[len(path)-1] == '/' {
+ path = path[0 : len(path)-1]
+ }
+
rules = append(rules, &Rule{path, run})
}
View
2  fixtures/example_config.json
@@ -2,7 +2,7 @@
"/tmp/foo": {
"run": "/usr/local/bar/foobar"
},
- "/tmp/bar": {
+ "/tmp/bar/": {
"run": "/usr/local/bar/barfoo"
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.