cmd/pk: strip knownKeys from dumpconfig

Fixes #1204

Change-Id: If463b84d8250ed1b0f48e6ed24b7d37843f082cb
This commit is contained in:
mpl 2018-09-26 01:59:59 +02:00
parent 2453859515
commit e6dd735c20
1 changed files with 3 additions and 0 deletions

View File

@ -21,6 +21,7 @@ import (
"errors"
"flag"
"os"
"regexp"
"perkeep.org/internal/osutil"
_ "perkeep.org/internal/osutil/gce"
@ -61,6 +62,8 @@ func (c *dumpconfigCmd) RunCommand(args []string) error {
if err != nil {
return err
}
knownKeys := regexp.MustCompile(`(?ms)^\s+"_knownkeys": {.+?},?\n`)
lowj = knownKeys.ReplaceAll(lowj, nil)
_, err = os.Stdout.Write(lowj)
return err
}