|
@@ -209,14 +209,22 @@ func (generator *ListGenerator) Run() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- log.Println("Uploading files to the cloud...")
|
|
|
- src, err := ioutil.ReadFile(filepath.Join(outputPath, "elenco_docenti.pdf"))
|
|
|
- if err != nil {
|
|
|
- log.Println(err)
|
|
|
- }
|
|
|
- err = generator.ncClient.Upload(src, filepath.Join(cloudPath, "elenco_docenti.pdf"))
|
|
|
- if err != nil {
|
|
|
- log.Println(err)
|
|
|
+ if !job.Document.KeepArtifacts {
|
|
|
+ log.Println("Uploading resulting files to the cloud...")
|
|
|
+ src, err := ioutil.ReadFile(filepath.Join(outputPath, "elenco_docenti.pdf"))
|
|
|
+ if err != nil {
|
|
|
+ log.Println(err)
|
|
|
+ }
|
|
|
+ err = generator.ncClient.Upload(src, filepath.Join(cloudPath, "elenco_docenti.pdf"))
|
|
|
+ if err != nil {
|
|
|
+ log.Println(err)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ log.Println("Uploading resulting files and artifacts to the cloud...")
|
|
|
+ _, err = generator.ncClient.UploadDir(filepath.Join(outputPath, "*"), cloudPath)
|
|
|
+ if err != nil {
|
|
|
+ log.Println(err)
|
|
|
+ }
|
|
|
}
|
|
|
log.Println("Files were uploaded to the cloud...")
|
|
|
}
|