MCPcopy Index your code
hub / github.com/callstack/haul / checkProject

Function checkProject

packages/haul-cli/src/commands/init.ts:17–46  ·  view source on GitHub ↗
(progress: Ora, cwd: string, runtime: Runtime)

Source from the content-addressed store, hash-verified

15 new Promise(resolve => setTimeout(resolve, time));
16
17async function checkProject(progress: Ora, cwd: string, runtime: Runtime) {
18 progress.start('Checking project files');
19 await delay(1000);
20
21 // Are we inside a React Native project?
22 if (getReactNativeVersion(cwd)) {
23 progress.succeed('Project looks good');
24 } else {
25 progress.fail(dedent`
26 This doesn't seem to be a React Native project.
27
28 Make sure you have a ${runtime.logger.enhanceWithModifier(
29 'bold',
30 'package.json'
31 )} file with ${runtime.logger.enhanceWithModifier(
32 'bold',
33 'react-native'
34 )} in dependencies, and you have installed these dependencies.
35
36 To generate a React Native project, run ${runtime.logger.enhanceWithModifier(
37 'bold',
38 'react-native init <ProjectName>'
39 )}. See ${runtime.logger.enhanceWithColor(
40 'cyan',
41 'https://facebook.github.io/react-native/docs/getting-started.html'
42 )} for details.
43 `);
44 runtime.complete(1);
45 }
46}
47
48async function createHaulProjectConfig(
49 progress: Ora,

Callers 1

handlerFunction · 0.85

Calls 4

getReactNativeVersionFunction · 0.90
delayFunction · 0.85
completeMethod · 0.80
startMethod · 0.65

Tested by

no test coverage detected