mirror of
https://github.com/vacp2p/rfc.vac.dev.git
synced 2025-02-23 04:48:26 +00:00
* 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
23 lines
537 B
JavaScript
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)
|
|
} |