-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcopyDistToDocs.js
More file actions
31 lines (26 loc) · 793 Bytes
/
Copy pathcopyDistToDocs.js
File metadata and controls
31 lines (26 loc) · 793 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* copyDistToDocs.js v0.0.2
*
* A JavaScript file to copy the contents of the 'dist' directory to the 'docs'
* directory in the root of the project. This is useful for GitHub Pages to
* serve the contents of the 'docs' directory.
*
* Website:
*
* https://sine-wave-generator.com
*
* Source:
*
* https://github.com/sebastienrousseau/sine-wave-generator
*
*/
"use strict";
const fs = require("fs-extra");
const path = require("path");
const distPath = path.resolve(__dirname, "dist");
const docsPath = path.resolve(__dirname, "docs");
// Ensure the 'docs' directory exists
fs.ensureDirSync(docsPath);
// Copy the contents of the 'dist' directory to the 'docs' directory
fs.copySync(distPath, docsPath, { overwrite: true });
console.log("Copied contents of dist to docs");