mirror of
https://github.com/vbatts/go-mtree.git
synced 2024-11-15 05:08:40 +00:00
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
1 changed files with 11 additions and 0 deletions
|
@ -294,6 +294,17 @@ func mainApp(c *cli.Context) error {
|
|||
if err != nil {
|
||||
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 {
|
||||
// with a root directory
|
||||
stateDh, err = mtree.Walk(rootPath, excludes, currentKeywords, nil)
|
||||
|
|
Loading…
Reference in a new issue