-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathfiles-copy.js
More file actions
15 lines (13 loc) · 777 Bytes
/
files-copy.js
File metadata and controls
15 lines (13 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const copyFiles = require("copyfiles");
const path = require("path");
const directories = ["assets", "config", "layout", "locales", "sections", "snippets", "templates"];
directories.forEach((dir) => {
if (dir === "templates") {
copyFiles([`src${path.sep}${dir}${path.sep}**`, `dist${path.sep}${dir}`], { up: true, exclude: `src${path.sep}${dir}${path.sep}customers${path.sep}*` }, () => console.log(`copied ${dir}`));
copyFiles([`src${path.sep}${dir}${path.sep}customers${path.sep}*`, `dist${path.sep}${dir}${path.sep}customers`], { up: true }, () => console.log(`copied ${dir}${path.sep}customers`));
} else {
copyFiles([`src${path.sep}${dir}${path.sep}**`, `dist${path.sep}${dir}`], { up: true }, () => {
console.log(`copied ${dir}`);
});
}
});