-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.js
More file actions
37 lines (28 loc) · 1.11 KB
/
Copy pathtest.js
File metadata and controls
37 lines (28 loc) · 1.11 KB
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
36
37
const fs = require('fs');
const path = require('path');
const { FolderUtil } = require('./dist');
async function hash(dir, outputName) {
const x = await FolderUtil.getHash(dir, ({ fullPath, dir, state }) => {
if (dir && state == 0) {
console.log(fullPath)
}
});
const output = path.join(process.cwd(), outputName);
fs.writeFileSync(output, JSON.stringify(x, null, 4));
}
async function test0() {
await hash('C:\\Users\\sw2\\source\\repos\\Projects\\tap.erp\\Tap.ERP.Api\\bin\\Debug\\net6.0\\publish', "output.json");
}
async function test1() {
await hash('C:\\Users\\sw2\\source\\repos\\Projects\\tap.erp\\Tap.ERP.Api\\bin\\Debug\\net6.0\\publish', "output1.json");
await hash('D:\\2', "output2.json");
}
async function test2() {
const from = 'C:\\Users\\sw2\\source\\repos\\Projects\\tap.erp\\Tap.ERP.Api\\bin\\Debug\\net6.0\\publish';
const to = 'D:\\2';
const x = await FolderUtil.diff(from, to, "d:\\2");
console.log(x)
const output = path.join(process.cwd(), "sync.bat");
fs.writeFileSync(output, x.join("\n"));
}
test2().then(console.log)