-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreProd.js
43 lines (37 loc) · 1.17 KB
/
preProd.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
36
37
38
39
40
41
42
const { Client } = require('pg');
/**
* Simple Node.js recursivily copy/rename files with specific pattern
* @license WTFPL
* @usage $ node preProd.js
*/
var fs = require('fs');
let targetDir= __dirname + '/static/';
let serverDev= targetDir+'server-dev.html';
let serverCssDev= targetDir+'css/'+'server-dev.css';
let serverJsDev= targetDir+'js/'+'server-dev.js';
let server= targetDir+'server.html';
let serverCss= targetDir+'css/'+'server.css';
let serverJs= targetDir+'js/'+'server.js';
let clientDev= targetDir+'client-dev.html';
let clientCssDev= targetDir+'css/'+'client-dev.css';
let clientJsDev= targetDir+'js/'+'client-dev.js';
let client= targetDir+'client.html';
let clientCss= targetDir+'css/'+'client.css';
let clientJs= targetDir+'js/'+'client.js';
function preProd(src, des) {
fs.copyFile(src,des, (err) => {
if (err) {
console.log("Error Found:", err);
}
else {
console.log(`\nFile copied`,des);
}
});
}
preProd(serverDev, server);
preProd(serverCssDev, serverCss);
preProd(serverJsDev, serverJs);
preProd(clientDev, client);
preProd(clientCssDev, clientCss);
preProd(clientJsDev, clientJs);
return 0;