Skip to content
Merged
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
1 change: 0 additions & 1 deletion packages/cli-platform-android/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"fs-extra": "^8.1.0",
"glob": "^7.1.3",
"jetifier": "^1.6.2",
"lodash": "^4.17.15",
"logkitty": "^0.7.1",
"slash": "^3.0.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"react-native": ">=0.4.0 || 0.5.0-rc1 || 0.6.0-rc || 0.7.0-rc || 0.7.0-rc.2 || 0.8.0-rc || 0.8.0-rc.2 || 0.9.0-rc || 0.10.0-rc || 0.11.0-rc || 0.12.0-rc || 0.13.0-rc || 0.14.0-rc || 0.15.0-rc || 0.16.0-rc"
},
"dependencies": {
"lodash": "^4.17.10",
"yargs": "^3.30.0",
"rnpm-plugin-test": "*"
},
Expand Down
1 change: 0 additions & 1 deletion packages/cli-platform-ios/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"execa": "^1.0.0",
"glob": "^7.1.3",
"js-yaml": "^3.13.1",
"lodash": "^4.17.15",
"ora": "^5.4.1",
"plist": "^3.0.2"
},
Expand Down
4 changes: 0 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
"find-up": "^4.1.0",
"fs-extra": "^8.1.0",
"graceful-fs": "^4.1.3",
"lodash": "^4.17.15",
"minimist": "^1.2.0",
"prompts": "^2.4.0",
"semver": "^6.3.0"
},
Expand All @@ -51,8 +49,6 @@
"@types/fs-extra": "^8.1.0",
"@types/graceful-fs": "^4.1.3",
"@types/hapi__joi": "^17.1.6",
"@types/lodash": "^4.14.149",
"@types/minimist": "^1.2.0",
"@types/prompts": "^2.0.9",
"@types/semver": "^6.0.2",
"deepmerge": "^3.2.0",
Expand Down
12 changes: 3 additions & 9 deletions packages/cli/src/commands/init/init.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os from 'os';
import path from 'path';
import fs from 'fs-extra';
import minimist from 'minimist';
import {validateProjectName} from './validate';
import DirectoryAlreadyExistsError from './errors/DirectoryAlreadyExistsError';
import printRunInstructions from './printRunInstructions';
Expand Down Expand Up @@ -31,6 +30,7 @@ type Options = {
displayName?: string;
title?: string;
skipInstall?: boolean;
version?: string;
};

interface TemplateOptions {
Expand Down Expand Up @@ -196,16 +196,10 @@ export default (async function initialize(
[projectName]: Array<string>,
options: Options,
) {
const root = process.cwd();

validateProjectName(projectName);

/**
* Commander is stripping `version` from options automatically.
* We have to use `minimist` to take that directly from `process.argv`
*/
const version: string = minimist(process.argv).version || DEFAULT_VERSION;

const root = process.cwd();
const version = options.version || DEFAULT_VERSION;
const directoryName = path.relative(root, options.directory || projectName);

try {
Expand Down