Skip to content

Commit

Permalink
Hide --internal-testing-template (former --template) CLI option
Browse files Browse the repository at this point in the history
  • Loading branch information
EnoahNetzach committed Jan 18, 2017
1 parent c5805c2 commit bc9edfa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions packages/create-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ if (currentNodeVersion.split('.')[0] < 4) {
process.exit(1);
}

var commander = require('commander');
var fs = require('fs-extra');
var path = require('path');
var execSync = require('child_process').execSync;
Expand All @@ -60,7 +61,7 @@ var semver = require('semver');

var projectName;

var program = require('commander')
var program = commander
.version(require('./package.json').version)
.arguments('<project-directory>')
.usage(chalk.green('<project-directory>') + ' [options]')
Expand All @@ -69,7 +70,7 @@ var program = require('commander')
})
.option('--verbose', 'print additional logs')
.option('--scripts-version <alternative-package>', 'use a non-standard version of react-scripts')
.option('--template <path-to-template>', 'use a non-standard application template')
.allowUnknownOption()
.on('--help', function () {
console.log(' Only ' + chalk.green('<project-directory>') + ' is required.');
console.log();
Expand All @@ -96,7 +97,12 @@ if (typeof projectName === 'undefined') {
process.exit(1);
}

createApp(projectName, program.verbose, program.scriptsVersion, program.template);
var hiddenProgram = new commander.Command()
.option('--internal-testing-template <path-to-template>', '(internal usage only, DO NOT RELY ON THIS) ' +
'use a non-standard application template')
.parse(process.argv)

createApp(projectName, program.verbose, program.scriptsVersion, hiddenProgram.internalTestingTemplate);

function createApp(name, verbose, version, template) {
var root = path.resolve(name);
Expand Down
2 changes: 1 addition & 1 deletion tasks/e2e-kitchensink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ npm install $cli_path

# Install the app in a temporary location
cd $temp_app_path
create_react_app --scripts-version=$scripts_path --template=$root_path/packages/react-scripts/fixtures/kitchensink test-kitchensink
create_react_app --scripts-version=$scripts_path --internal-testing-template=$root_path/packages/react-scripts/fixtures/kitchensink test-kitchensink

# ******************************************************************************
# Now that we used create-react-app to create an app depending on react-scripts,
Expand Down

0 comments on commit bc9edfa

Please sign in to comment.