1
0
mirror of https://github.com/strongdm/comply synced 2024-11-22 15:44:55 +00:00

more verbose output in the interest of educating users on input and output paths

This commit is contained in:
Justin McCarthy 2018-05-17 22:52:39 -07:00
parent e97f0684ac
commit 8fbc7ab65a
No known key found for this signature in database
GPG Key ID: 900437410E142A48
3 changed files with 14 additions and 19 deletions

View File

@ -59,9 +59,7 @@ func html(output string, live bool, errCh chan error, wg *sync.WaitGroup) {
return return
} }
if live { fmt.Printf("%s -> %s\n", filepath.Join("templates", fileInfo.Name()), outputFilename)
fmt.Printf("%s -> %s\n", filepath.Join("templates", fileInfo.Name()), outputFilename)
}
tpl, err := ace.Load("", filepath.Join("templates", basename), aceOpts) tpl, err := ace.Load("", filepath.Join("templates", basename), aceOpts)
if err != nil { if err != nil {

View File

@ -49,14 +49,6 @@ func renderNarrativeToDisk(wg *sync.WaitGroup, errOutputCh chan error, data *ren
go func(p *model.Narrative) { go func(p *model.Narrative) {
defer wg.Done() defer wg.Done()
if live {
rel, err := filepath.Rel(config.ProjectRoot(), p.FullPath)
if err != nil {
rel = p.FullPath
}
fmt.Printf("%s -> %s\n", rel, filepath.Join("output", p.OutputFilename))
}
outputFilename := p.OutputFilename outputFilename := p.OutputFilename
// save preprocessed markdown // save preprocessed markdown
err = preprocessNarrative(data, p, filepath.Join(".", "output", outputFilename+".md")) err = preprocessNarrative(data, p, filepath.Join(".", "output", outputFilename+".md"))
@ -112,6 +104,13 @@ func renderNarrativeToDisk(wg *sync.WaitGroup, errOutputCh chan error, data *ren
errOutputCh <- err errOutputCh <- err
return return
} }
rel, err := filepath.Rel(config.ProjectRoot(), p.FullPath)
if err != nil {
rel = p.FullPath
}
fmt.Printf("%s -> %s\n", rel, filepath.Join("output", p.OutputFilename))
}(narrative) }(narrative)
} }

View File

@ -49,14 +49,6 @@ func renderPolicyToDisk(wg *sync.WaitGroup, errOutputCh chan error, data *render
go func(p *model.Policy) { go func(p *model.Policy) {
defer wg.Done() defer wg.Done()
if live {
rel, err := filepath.Rel(config.ProjectRoot(), p.FullPath)
if err != nil {
rel = p.FullPath
}
fmt.Printf("%s -> %s\n", rel, filepath.Join("output", p.OutputFilename))
}
outputFilename := p.OutputFilename outputFilename := p.OutputFilename
// save preprocessed markdown // save preprocessed markdown
err = preprocessPolicy(data, p, filepath.Join(".", "output", outputFilename+".md")) err = preprocessPolicy(data, p, filepath.Join(".", "output", outputFilename+".md"))
@ -110,6 +102,12 @@ func renderPolicyToDisk(wg *sync.WaitGroup, errOutputCh chan error, data *render
errOutputCh <- err errOutputCh <- err
return return
} }
rel, err := filepath.Rel(config.ProjectRoot(), p.FullPath)
if err != nil {
rel = p.FullPath
}
fmt.Printf("%s -> %s\n", rel, filepath.Join("output", p.OutputFilename))
}(policy) }(policy)
} }