summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go38
1 files changed, 23 insertions, 15 deletions
diff --git a/main.go b/main.go
index a93af29..ae4babe 100644
--- a/main.go
+++ b/main.go
@@ -53,10 +53,17 @@ func main() {
os.Exit(-1)
}
+ var newEvents []*pb.Event
+
// sanity check the droplets
checkDroplets(false)
+ newe := checkDiskFilenames()
+ for _, e := range newe {
+ newEvents = append(newEvents, e)
+ }
+ checkUniqueFilenames()
+
- var newEvents []*pb.Event
for _, filename := range argv.Xml {
domcfg, err := readXml(filename)
if err != nil {
@@ -81,21 +88,22 @@ func main() {
newEvents = append(newEvents, e)
}
}
- if len(argv.Xml) != 0 {
- for i, e := range newEvents {
- log.Info(i, "Event:", e.Droplet, e.FieldName, "orig:", e.OrigVal, "new:", e.NewVal)
- }
- if me.changed {
- if argv.Save {
- writeConfigFile()
- writeConfigFileDroplets()
- log.Info("XML changes saved in protobuf config")
- os.Exit(0)
- } else {
- log.Info("Not saving changes (use --save to save)")
- os.Exit(0)
- }
+ for i, e := range newEvents {
+ log.Info(i, "Event:", e.Droplet, e.FieldName, "orig:", e.OrigVal, "new:", e.NewVal)
+ me.changed = true
+ }
+ if me.changed {
+ if argv.Save {
+ writeConfigFile()
+ writeConfigFileDroplets()
+ log.Info("XML changes saved in protobuf config")
+ os.Exit(0)
+ } else {
+ log.Info("Not saving changes (use --save to save)")
+ os.Exit(0)
}
+ }
+ if len(argv.Xml) != 0 {
log.Info("No XML changes found")
os.Exit(0)
}