fix: presets tests

This commit is contained in:
lowlighter
2022-01-26 23:04:57 -05:00
parent 9c2df98fbf
commit 4e86e1b98b

View File

@@ -16,6 +16,10 @@ catch {
let { HEAD_REF: branch, REPO: repo } = process.env let { HEAD_REF: branch, REPO: repo } = process.env
branch = branch || "presets" branch = branch || "presets"
repo = repo || "lowlighter/metrics" repo = repo || "lowlighter/metrics"
if (!/^[/-\w\d]+$/.test(branch))
throw new Error(`invalid branch: ${branch}`)
if (!/^[-\w\d]+\/[-\w\d]+$/.test(repo))
throw new Error(`invalid repo: ${repo}`)
console.log(`cloning: ${repo}@${branch}`) console.log(`cloning: ${repo}@${branch}`)
processes.execSync(`git clone https://github.com/${repo}.git ${__presets} --branch ${branch} --single-branch`) processes.execSync(`git clone https://github.com/${repo}.git ${__presets} --branch ${branch} --single-branch`)
} }