From 1f8a352af0b8978d2076993935e0d1668b7584d5 Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Wed, 26 Jan 2022 19:33:29 -0500 Subject: [PATCH] ci: fix issue when folder not exists [skip ci] --- .github/scripts/presets_examples.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/presets_examples.mjs b/.github/scripts/presets_examples.mjs index 87b098f3..83575f04 100644 --- a/.github/scripts/presets_examples.mjs +++ b/.github/scripts/presets_examples.mjs @@ -14,7 +14,7 @@ console.log(`Mode: ${mode}`) const __metrics = paths.join(paths.dirname(url.fileURLToPath(import.meta.url)), "../..") 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}) const git = sgit(__presets) await git.pull()