forked from alibaba/lowcode-engine
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.js
More file actions
29 lines (23 loc) · 790 Bytes
/
setup.js
File metadata and controls
29 lines (23 loc) · 790 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
27
28
29
#!/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('pnpm-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('pnpm i', { stdio: 'inherit', encoding: 'utf-8' });
}
const setup = gulp.series(deleteRootDirLockFile, deletePackagesDirLockFile, bootstrap);
os.type() === 'Windows_NT'
? setup()
: execa.command('scripts/setup.sh', { stdio: 'inherit', encoding: 'utf-8' });