mirror of https://github.com/vbatts/go-mtree.git
main: compare two files with two -f flags
Fixes: #159 ```shell vbatts@fogel:~/src/github.com/vbatts/go-mtree$ ./gomtree -c -f foo vbatts@fogel:~/src/github.com/vbatts/go-mtree$ ./gomtree -c -f bar -K sha256 vbatts@fogel:~/src/github.com/vbatts/go-mtree$ ./gomtree -f foo -f bar "foo": unexpected path ".": keyword "time": expected 1649109728.228935367; got 1649109734.412959677 FATA[0000] manifest validation failed vbatts@fogel:~/src/github.com/vbatts/go-mtree$ echo $? 1 ``` Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
bdace0aacf
commit
b5e683dfc9
|
@ -294,6 +294,17 @@ func mainApp(c *cli.Context) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
} else if len(c.StringSlice("file")) > 1 {
|
||||||
|
// load this second hierarchy file provided
|
||||||
|
fh, err := os.Open(c.StringSlice("file")[1])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
stateDh, err = mtree.ParseSpec(fh)
|
||||||
|
fh.Close()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// with a root directory
|
// with a root directory
|
||||||
stateDh, err = mtree.Walk(rootPath, excludes, currentKeywords, nil)
|
stateDh, err = mtree.Walk(rootPath, excludes, currentKeywords, nil)
|
||||||
|
|
Loading…
Reference in New Issue