Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function installReactNative(nameProject) {
// check exist rn
const { stdout, stderr } = await exec(`cd ${process.cwd()}/ && react-native -v`)
if (stdout.indexOf('n/a') > 0) {
await exec(`react-native init ${nameProject}`);
}
print.warning(`Your folder name ${nameProject} is existed R-N`);
}
async function copyIndexFile(nameProject) {
function getConfigPath(fileName: string, strict: boolean = false) {
const configPath = filesystem.path(fileName);
if (filesystem.exists(configPath)) {
print.info(`Configuration file found ${configPath}`);
return configPath;
}
if (strict) {
throw new FileNotFoundException(`File not found ${configPath}`);
} else {
print.warning(
`Unable to find "${fileName}" reverting to default configuration`,
);
}
return false;
}