forked from OneKeyHQ/cross-inpage-provider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
35 lines (30 loc) · 960 Bytes
/
gulpfile.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
const gulp = require('gulp');
const { execSync, exec } = require('child_process');
function execCmd(cmd) {
return execSync(cmd, { stdio: 'inherit' });
}
function build(cb) {
exec('yarn start', { stdio: 'inherit' });
cb();
}
function buildInjected(cb) {
// execSync('yarn build-inject');
execCmd('cd packages/injected && yarn build && cd -');
execCmd('sh rsync-npm.sh');
// TODO use .env set onekey-app-monorepo folder
execCmd('cd ~/workspace/onekey-app-monorepo && yarn copy:inject && cd -');
execCmd('echo ">>>>>>>>>>>>>>> "');
execCmd(
'echo "\t Manually update app-monorepo WebView.js comment hash in code make iOS hot-reload take effect."',
);
execCmd('echo ">>>>>>>>>>>>>>> "');
cb();
}
function watching(cb) {
gulp.watch(['packages/**/src/**/*.ts'], buildInjected);
cb();
}
const watch = gulp.series(buildInjected, watching);
exports.default = buildInjected;
exports.build = buildInjected;
exports.watch = watch;