Skip to content

Commit ecd2665

Browse files
fix: tidy up, moving fns to top, etc
1 parent ea53a93 commit ecd2665

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

setup.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ const isYarnAvailable = () => {
1616
return false;
1717
}
1818
}
19+
const currPackager = isYarnAvailable ? "yarn" : "npm";
20+
const logInstallingWith = pkg => console.log(`\n📦 Installing dependencies with ${pkg}...\n`);
21+
const execOptions = {
22+
stdio: 'inherit'
23+
}
1924

2025
console.log('\n🔄 Please wait...\n');
2126

2227
packageJson.scripts.start = `${packageJson.scripts.start} --config ../../../../rn-cli.config.js`;
2328
packageJson.jest = Object.assign(packageJson.jest, jestJson);
2429
writeFile('package.json', JSON.stringify(packageJson, null, 2));
2530

26-
const logInstallingWith = pkg => console.log(`\n📦 Installing dependencies with ${pkg}...\n`);
27-
const execOptions = {
28-
stdio: 'inherit'
29-
}
31+
logInstallingWith(currPackager);
3032

3133
if (isYarnAvailable) {
32-
logInstallingWith("yarn");
3334
execSync(`yarn add ${devDependencies.join(' ')} --dev --exact`, execOptions);
3435
} else {
35-
logInstallingWith("npm");
3636
execSync(`npm i ${devDependencies.join(' ')} --save-dev --save-exact`, execOptions);
3737
}
3838

@@ -45,4 +45,4 @@ deleteFile('README.md');
4545
deleteFile('LICENSE');
4646
deleteFile('setup.js');
4747

48-
console.log(`\n✅ Setup completed! You can now start with: ${isYarnAvailable ? "yarn" : "npm"} start\n`);
48+
console.log(`\n✅ Setup completed! You can now start with: ${currPackager} start\n`);

0 commit comments

Comments
 (0)