forked from Acode-Foundation/Acode
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmove-files.js
More file actions
36 lines (32 loc) · 1.03 KB
/
move-files.js
File metadata and controls
36 lines (32 loc) · 1.03 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
const path = require('path');
const fs = require('fs');
const gradleFilePath = path.resolve(__dirname, '../build-extras.gradle');
const newGradleFilePath = path.resolve(
__dirname,
'../platforms/android/app/build-extras.gradle'
);
const buildFilePath = path.resolve(__dirname, '../build.json');
const newBuildFilePath = path.resolve(
__dirname,
'../platforms/android/build.json'
);
const repeatChar = (char, times) => {
let res = '';
while (--times >= 0) res += char;
return res;
};
let msg;
if (!fs.existsSync(newBuildFilePath) && fs.existsSync(buildFilePath)) {
msg = '== Moved build.json ==';
console.log(repeatChar('=', msg.length));
console.log(msg);
console.log(repeatChar('=', msg.length));
fs.copyFileSync(buildFilePath, newBuildFilePath);
}
if (!fs.existsSync(newGradleFilePath) && fs.existsSync(gradleFilePath)) {
msg = '== Moved build-extras.gradle ==';
console.log(repeatChar('=', msg.length));
console.log(msg);
console.log(repeatChar('=', msg.length));
fs.copyFileSync(gradleFilePath, newGradleFilePath);
}