-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.js
89 lines (42 loc) · 1.53 KB
/
build.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
const fs = require('fs-extra')
const Folder = './';
const dist_folder_arr = ["./build_distribution_package/linux/robbojunior/opt/junior/jr/resources/app/","./build_distribution_package/linux/robbojunior-x32/opt/junior/jr/resources/app/"];
var copyFiles = function(){
var Files_arr = [];
fs.readdir(Folder, (err, files) => {
files.forEach(file => {
FilterFunc(file);
});
})
}
//Files_arr.forEach(entry => console.log(entry));
var FilterFunc = function(file){
var fileName = "";
var FORBIDDEN = ["build_distribution_package","src",".git","build.sh","build.sh.old","build.js","README.md",".gitignore","node_modules","_svglibrary","_media.json","package-lock.json"];
//FORBIDDEN.forEach(entry => {if (entry != file) console.log(file); else console.log("forbidden")});
if ( FORBIDDEN.indexOf(file) == -1 )
{
// console.log(file);
/* if ( fs.lstatSync("./"+file).isFile() ) {
fileName = file;
}
else{
fileName = "";
} */
fs.copy('./' + file, dist_folder_arr[0] + file)
.then(() => {
console.log( file + ' was sucessfully copied to' + dist_folder_arr[0]);
})
.catch(err => {
console.error(err)
})
fs.copy('./' + file, dist_folder_arr[1] +file)
.then(() => {
console.log( file + ' was sucessfully copied to' + dist_folder_arr[1]);
})
.catch(err => {
console.error(err)
})
}
};
copyFiles();