summaryrefslogtreecommitdiff
path: root/cmd/ponzu/usage.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2017-01-17 16:31:38 -0800
committerSteve Manuel <nilslice@gmail.com>2017-01-17 16:31:38 -0800
commit36bd970589e92c09709aa778f9ff02d16fde7e08 (patch)
tree87d113ddec8dd7310134115edc2794b7f69e1fcc /cmd/ponzu/usage.go
parent3c5a7f8020eeebb50a94c0c997dfd7404b1afabc (diff)
adding version (in general ponzu.json file) and upgrade command to backup, clone new ponzu and restore files to keep up to date as ponzu project is updated
Diffstat (limited to 'cmd/ponzu/usage.go')
-rw-r--r--cmd/ponzu/usage.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/cmd/ponzu/usage.go b/cmd/ponzu/usage.go
index 2d7a3b8..6787ca1 100644
--- a/cmd/ponzu/usage.go
+++ b/cmd/ponzu/usage.go
@@ -1,7 +1,10 @@
package main
import (
+ "encoding/json"
"fmt"
+ "io/ioutil"
+ "path/filepath"
"time"
)
@@ -121,3 +124,19 @@ var usageRun = `
`
+
+func ponzu() (map[string]interface{}, error) {
+ kv := make(map[string]interface{})
+
+ b, err := ioutil.ReadFile(filepath.Join("cmd", "ponzu", "ponzu.json"))
+ if err != nil {
+ return nil, err
+ }
+
+ err = json.Unmarshal(b, &kv)
+ if err != nil {
+ return nil, err
+ }
+
+ return kv, nil
+}