From b50f8449aab6ad8445719fa3062e086c6bd83678 Mon Sep 17 00:00:00 2001 From: Jan Andrle Date: Fri, 22 Nov 2024 11:10:12 +0100 Subject: [PATCH] :bug: (bs/docs) Fixes (non)exsting docs target --- bs/docs.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bs/docs.js b/bs/docs.js index 68f5385..852210a 100755 --- a/bs/docs.js +++ b/bs/docs.js @@ -7,6 +7,13 @@ import { createHTMl } from "./docs/jsdom.js"; import { register } from "../jsdom.js"; const pkg= s.cat("package.json").xargs(JSON.parse); +if(s.test("-d", path_target.root)){ + echo("Removing old files…"); + s.rm("-rf", path_target.root+"*"); +} else { + echo("Creating directory…"); + s.mkdir("-p", path_target.root); +} echo("Collecting list of pages…"); const pages= s.ls($.xdg.main`../docs/*.html.js`).map(addPage); for(const { id, info } of pages){