From c3a9c216191d712da2b872d3aa65abad03b37b73 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sun, 13 Dec 2020 10:58:24 -0600 Subject: [PATCH] move to script folder --- package.json | 2 +- build-docs.js => scripts/build-docs.js | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) rename build-docs.js => scripts/build-docs.js (93%) diff --git a/package.json b/package.json index 0493c60..c960309 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "test:integration:local": "docker-compose up -d && npm run test:integration && docker-compose down", "lint": "eslint . --fix", "lint:ci": "eslint .", - "docs": "node build-docs.js" + "docs": "node scripts/build-docs.js" }, "husky": { "hooks": { diff --git a/build-docs.js b/scripts/build-docs.js similarity index 93% rename from build-docs.js rename to scripts/build-docs.js index 56ee381..b60a6c3 100644 --- a/build-docs.js +++ b/scripts/build-docs.js @@ -70,8 +70,8 @@ function createHTML (header, footer, text) { } async function createDocs () { - const docs = path.join(__dirname, 'docs') - const dist = path.join(__dirname, 'public') + const docs = path.resolve(__dirname, '..', 'docs') + const dist = path.resolve(__dirname, '..', 'public') await fs.rmdir(dist, { recursive: true }) await fs.mkdir(dist) @@ -98,4 +98,7 @@ async function createDocs () { await fs.copyFile(path.join(src, 'img', 'logo.svg'), path.join(dest, 'img', 'logo.svg')) } -createDocs() +createDocs().catch(ex => { + console.error(ex) + process.exit(1) +})