-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copier.js
36 lines (24 loc) · 843 Bytes
/
Copier.js
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
32
33
34
35
const makeSynchronous = require(`make-synchronous`);
const fs = require(`fs-extra`);
const path = require(`path`);
const _ = require(`lodash`);
const NODE_MODULES = `node_modules`;
const THE_ROOT_MODULE = `__THE_ROOT_MODULE__`;
class Copier {
constructor({ projectPath, targetPath, includeOptional = false, includePeers = false } = {}) {
if (projectPath === null || projectPath === undefined) {
throw new Error(`projectPath must be defined.`);
}
if (targetPath === null || targetPath === undefined) {
throw new Error(`targetPath must be defined.`);
}
// resolve path names for file copying
this.projectPath = path.resolve(projectPath);
this.targetPath = path.resolve(targetPath);
this.includeOptional = includeOptional;
this.includePeers = includePeers;
}
async execute() {
}
}
module.exports = Copier;