mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
* feat: create nocobase app with simple & quickstart option * chore: delete template file * create-nocobase-app: add env API_PORT fallback * chore: log * env default fallback * move config dir * change has yarn * chore: prettier * fix: npm running issue * database testing support sqlite * once... * chore: typo * fix: sqlite test * update readme * feat: copy .env.example to .env at create-nocobase-app * create-nocobase-app: change sqlite3 to github master * create-nocobase-app: .env template * create-nocobase-app: update .env * chore: typo * update README * chore: Application constructor * feat: sqlite demo data support * fix test * fix: application error * chore: plugin-client run sql * fix: application createCli * fix: can choose whether to register actions * chore: model compile error * fix: support sqlite * fix: demo data set index sequence on postgresql * chore: code reduce * fix: operators are compatible with sqlite * add impor demo option to init command * update env Co-authored-by: chenos <chenlinxh@gmail.com>
29 lines
608 B
TypeScript
29 lines
608 B
TypeScript
import execa from 'execa';
|
|
|
|
export function hasYarn() {
|
|
return (process.env.npm_config_user_agent || '').indexOf('yarn') === 0;
|
|
}
|
|
|
|
function runYarn(path: string, args: string[]) {
|
|
if (hasYarn()) {
|
|
return execa('yarn', args, {
|
|
cwd: path,
|
|
stdin: 'ignore',
|
|
});
|
|
}
|
|
|
|
return execa('npm', args, { cwd: path, stdin: 'ignore' });
|
|
}
|
|
|
|
export function runInstall(path) {
|
|
return runYarn(path, ['install']);
|
|
}
|
|
|
|
export function runStart(path) {
|
|
return runYarn(path, ['run', 'start']);
|
|
}
|
|
|
|
export function runInit(path) {
|
|
return runYarn(path, ['run', 'nocobase', 'init', '--import-demo']);
|
|
}
|