Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/@react-native-windows/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ Here are the options that `npx @react-native-community/cli init-windows` takes:
| `--namespace` | string | The native project namespace, expressed using dots as separators, i.e. `Level1.Level2.Level3`. Defaults to the same as name |
| `--overwrite` | boolean | Overwrite any existing files without prompting |
| `--no-telemetry` | boolean | Disables sending telemetry that allows analysis of usage and failures of the react-native-windows CLI |
| `--list` | boolean | Shows a list with all available templates with their descriptions |
| `--no-prompt` | boolean | Skip any interactive prompts and use default choices |
| `--no-example` | boolean | Skip creating the example app directory |
| `-h`, `--help` | boolean | Display help for command |

## `run-windows`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface InitOptions {
telemetry?: boolean;
list?: boolean;
prompt?: boolean;
example?: boolean;
}

export const initOptions: CommandOption[] = [
Expand Down Expand Up @@ -57,4 +58,8 @@ export const initOptions: CommandOption[] = [
name: '--no-prompt',
description: 'Skip any interactive prompts and use default choices.',
},
{
name: '--no-example',
description: 'Skip creating the example app directory.',
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function validateOptionName(
case 'telemetry':
case 'list':
case 'prompt':
case 'example':
return true;
}
throw new Error(
Expand Down
2 changes: 1 addition & 1 deletion vnext/templates/cpp-lib/template.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function resolveArgs(config = {}, options = {}) {

const exampleProjectPath = path.join(projectRoot, 'example');

const exExists = existsSync(exampleProjectPath);
const exExists = existsSync(exampleProjectPath) && options.example !== false;
const exProjectConfig = exExists
? templateUtils.getWindowsProjectConfig(exampleProjectPath)
: null;
Expand Down