-
-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathrunSetupCI.ts
More file actions
29 lines (22 loc) · 844 Bytes
/
runSetupCI.ts
File metadata and controls
29 lines (22 loc) · 844 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
import { Toolbox } from 'gluegun/build/types/domain/toolbox';
import { getPackageManager } from './getPackageManager';
import { CliResults } from '../types';
const SUPPORTED_PACKAGE_MANAGERS = ['yarn', 'npm'];
export async function isProjectCompatibleWithSetupCI(toolbox: Toolbox, cliResults: CliResults) {
const packageManager = getPackageManager(toolbox, cliResults);
const { noGit, noInstall } = cliResults.flags;
return !noGit && !noInstall && SUPPORTED_PACKAGE_MANAGERS.includes(packageManager);
}
export async function runSetupCI(toolbox: Toolbox, cliResults: CliResults) {
const {
print: { info },
system
} = toolbox;
const { projectName } = cliResults;
info(``);
info('Running setup-ci...');
await system.spawn(`cd ${projectName} && npx setup-ci@latest`, {
shell: true,
stdio: 'inherit'
});
}