forked from alibaba/lowcode-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.js
More file actions
26 lines (20 loc) · 794 Bytes
/
setup.js
File metadata and controls
26 lines (20 loc) · 794 Bytes
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
#!/usr/bin/env node
const os = require('os');
const del = require('del');
const gulp = require('gulp');
const execa = require('execa');
async function deleteRootDirLockFile() {
await del('package-lock.json');
await del('yarn.lock');
}
async function clean() {
await execa.command('lerna clean -y', { stdio: 'inherit', encoding: 'utf-8' });
}
async function deletePackagesDirLockFile() {
await del('packages/**/package-lock.json');
}
async function bootstrap() {
await execa.command('lerna bootstrap --force-local', { stdio: 'inherit', encoding: 'utf-8' });
}
const setup = gulp.series(deleteRootDirLockFile, clean, deletePackagesDirLockFile, bootstrap);
os.type() === 'Windows_NT' ? setup() : execa.command('scripts/setup.sh', { stdio: 'inherit', encoding: 'utf-8' });