Filip Pajic 1788712c98
chore: Build streamlined (#4)
* chore: create a command for unified build and scrape flow

* chore: cleanup repo from temp folders

* feat: add new .md fetching mode

* feat: fetching through git added

* ci: add Scrape stage to the Jenkinsfile

* feat: add env variables to the Jenkinsfile
2024-06-25 07:54:16 +02:00

23 lines
537 B
JavaScript

// import clone from "git-clone/promise.js"
import { purgeOldFiles } from './file.mjs'
import gitDownload from "clone-git-repo"
async function clone(repoUrl, toDir) {
return new Promise((resolve, reject) => {
gitDownload(repoUrl, toDir, {}, (err) => {
if (err) {
reject(err)
} else {
resolve()
}
})
})
}
export async function pullWithGit(repoUrl, toDir) {
// If any old temp files that weren't removed are present
await purgeOldFiles(undefined, toDir)
await clone(repoUrl, toDir)
}