forked from topstar199026/ionic-webtorrent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch.js
More file actions
31 lines (26 loc) · 1.03 KB
/
Copy pathpatch.js
File metadata and controls
31 lines (26 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
const fs = require('fs');
const f = 'node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js';
fs.readFile(f, 'utf8', function (err,data) {
if (err) {
return console.log(err);
}
var result = data.replace(/node: false/g, 'node: {crypto: true, stream: true}');
fs.writeFile(f, result, 'utf8', function (err) {
if (err) return console.log(err);
});
});
// Copy Android.json
fs.copyFile("patch\\Android.json", "platforms\\android\\Android.json", (err) => {
if (err) throw err;
console.log('Android.json was copied to destination');
});
// Copy AndroidManifest.xml
fs.copyFile("patch\\AndroidManifest.xml", "platforms\\android\\app\\src\\main\\AndroidManifest.xml", (err) => {
if (err) throw err;
console.log('AndroidManifest.xml was copied to destination');
});
// Copy build-extras.gradle
fs.copyFile("patch\\build-extras.gradle", "platforms\\android\\app\\build-extras.gradle", (err) => {
if (err) throw err;
console.log('build-extras.gradle was copied to destination');
});