Skip to content

Commit 956afd1

Browse files
mathieudutourfson
authored andcommitted
add shortcut for typescript (expo#557)
1 parent f4af8a2 commit 956afd1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

create-react-native-app/src/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const argv = minimist(process.argv.slice(2));
2121
* --verbose - to print npm logs during init
2222
* --scripts-version <alternative package>
2323
* --reason - shortcut for: --scripts-version 'reason-react-native-scripts'
24+
* --typescript - shortcut for: --scripts-version 'react-native-scripts-ts'
2425
* --package-manager <package manager name or path>
2526
* Example of valid values:
2627
* - a specific npm version: "0.22.0-rc1"
@@ -41,7 +42,11 @@ if (commands.length === 0) {
4142
process.exit(1);
4243
}
4344

44-
const scriptsVersion = argv.reason ? 'reason-react-native-scripts' : argv['scripts-version'];
45+
const scriptsVersion = argv.reason
46+
? 'reason-react-native-scripts'
47+
: (argv.typescript
48+
? 'react-native-scripts-ts'
49+
: argv['scripts-version']);
4550

4651
createApp(commands[0], !!argv.verbose, scriptsVersion).then(() => {});
4752

0 commit comments

Comments
 (0)