Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const fs = require('fs');
const chalk = require('chalk');
const path = require('path');
const copyAndReplace = require('@react-native-community/cli/build/tools/copyAndReplace').default;
const walk = require('@react-native-community/cli/build/tools/walk').default;
const prompt = require('@react-native-community/cli/build/tools/generator/promptSync').default();
function createDir(destPath) {
if (!fs.existsSync(destPath)) {
fs.mkdirSync(destPath);
}
}
function copyAndReplaceWithChangedCallback(srcPath, destRoot, relativeDestPath, replacements, alwaysOverwrite) {
if (!replacements) {
replacements = {};
}
const contentChangedCallback = alwaysOverwrite ? (_, contentChanged) =>
alwaysOverwriteContentChangedCallback(
srcPath,
relativeDestPath,
contentChanged
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
'use strict';
const Common = require('./common');
const chalk = require('chalk');
const execSync = require('child_process').execSync;
const path = require('path');
const prompt = require('@react-native-community/cli/build/tools/generator/promptSync').default();
const REACT_NATIVE_WINDOWS_GENERATE_PATH = function() {
return path.resolve(
process.cwd(),
'node_modules',
'react-native-windows',
'local-cli',
'generate-windows.js'
);
};
module.exports = function (config, args, options) {
const name = args[0] ? args[0] : Common.getReactNativeAppName();
const ns = options.namespace ? options.namespace : name;
const version = options.windowsVersion ? options.windowsVersion : Common.getReactNativeVersion();
const fs = require('fs');
const chalk = require('chalk');
const path = require('path');
const copyAndReplace = require('@react-native-community/cli/build/tools/copyAndReplace').default;
const walk = require('@react-native-community/cli/build/tools/walk').default;
const prompt = require('@react-native-community/cli/build/tools/generator/promptSync').default();
function createDir(destPath) {
if (!fs.existsSync(destPath)) {
fs.mkdirSync(destPath);
}
}
function copyAndReplaceWithChangedCallback(srcPath, destRoot, relativeDestPath, replacements, alwaysOverwrite) {
if (!replacements) {
replacements = {};
}
const contentChangedCallback = alwaysOverwrite ? (_, contentChanged) =>
alwaysOverwriteContentChangedCallback(
srcPath,
relativeDestPath,
contentChanged