ci: fix issue when folder not exists [skip ci]

This commit is contained in:
lowlighter
2022-01-26 19:33:29 -05:00
parent ba72732262
commit 1f8a352af0

View File

@@ -14,7 +14,7 @@ console.log(`Mode: ${mode}`)
const __metrics = paths.join(paths.dirname(url.fileURLToPath(import.meta.url)), "../..") const __metrics = paths.join(paths.dirname(url.fileURLToPath(import.meta.url)), "../..")
const __presets = paths.join(__metrics, ".presets") const __presets = paths.join(__metrics, ".presets")
if (!(await fs.lstat(paths.join(__presets))).isDirectory()) if ((await fs.lstat(paths.join(__presets)).catch(_ => false))||(!(await fs.lstat(paths.join(__presets))).isDirectory()))
await sgit().clone("https://github.com/lowlighter/metrics.git", __presets, {"--branch":"presets", "--single-branch":true}) await sgit().clone("https://github.com/lowlighter/metrics.git", __presets, {"--branch":"presets", "--single-branch":true})
const git = sgit(__presets) const git = sgit(__presets)
await git.pull() await git.pull()