(dataFiles: DataFile[], mediaFiles: AssetProxy[], options: PersistOptions)
| 560 | } |
| 561 | |
| 562 | async persistFiles(dataFiles: DataFile[], mediaFiles: AssetProxy[], options: PersistOptions) { |
| 563 | const files = [...dataFiles, ...mediaFiles]; |
| 564 | const subfolders = options.hasSubfolders !== false; // default to true |
| 565 | if (options.useWorkflow) { |
| 566 | const slug = dataFiles[0].slug; |
| 567 | return this.editorialWorkflowGit(files, slug, options); |
| 568 | } else { |
| 569 | const items = await this.getCommitItems(files, this.branch, subfolders); |
| 570 | |
| 571 | return this.uploadAndCommit(items, options.commitMessage, this.branch, true); |
| 572 | } |
| 573 | } |
| 574 | |
| 575 | async deleteFiles(paths: string[], comment: string) { |
| 576 | const ref = await this.getRef(this.branch); |
no test coverage detected