mirror of
https://github.com/vbatts/go-mtree.git
synced 2024-11-22 00:15:39 +00:00
gomtree: allow manifest to be provided on stdin
like `gomtree -c -p /tmp/dir1 -K sha1 | gomtree -p /tmp/dir2` Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
b7967864aa
commit
21a2577f01
1 changed files with 13 additions and 0 deletions
|
@ -257,6 +257,19 @@ func app() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// no spec manifest has been provided yet, so look for it on stdin
|
||||
if specDh == nil {
|
||||
// load the hierarchy
|
||||
specDh, err = mtree.ParseSpec(os.Stdin)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// We can't check against more fields than in the specKeywords list, so
|
||||
// currentKeywords can only have a subset of specKeywords.
|
||||
specKeywords = specDh.UsedKeywords()
|
||||
}
|
||||
|
||||
// This is a validation.
|
||||
if specDh != nil && stateDh != nil {
|
||||
var res []mtree.InodeDelta
|
||||
|
|
Loading…
Reference in a new issue