Skip to content

Commit 3521e4d

Browse files
committed
fix(CLI): bug fix to generator CLI
1 parent d771156 commit 3521e4d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

local-cli/rnpm/windows/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rnpm-plugin-windows",
3-
"version": "0.2.1",
3+
"version": "0.2.2",
44
"description": "rnpm plugin that generates a Windows template project",
55
"main": "index.js",
66
"scripts": {

local-cli/rnpm/windows/src/windows.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ function getLatestVersion() {
4141
.then(result => result.version)
4242
}
4343

44-
function checkPackageExists(version) {
44+
function getMatchingVersion(version) {
4545
return fetch(`https://registry.npmjs.org/react-native-windows?version=${version}`)
4646
.then(result => {
4747
if (result && result.ok) {
4848
return result.json().then(pkg => pkg.version);
4949
} else {
50-
return getLatestPackage().then(latestVersion => {
50+
return getLatestVersion().then(latestVersion => {
5151
throw new Error(`Could not find react-native-windows@${version}. ` +
5252
`Latest version of react-native-windows is ${latestVersion}, try switching to ` +
5353
`react-native@${semver.major(latestVersion)}.${semver.minor(latestVersion)}.*.`);
@@ -71,7 +71,7 @@ function getInstallPackage(version) {
7171

7272
const validVersionOrRange = validVersion || validRange;
7373
if (validVersionOrRange) {
74-
return checkPackageExists(validVersionOrRange)
74+
return getMatchingVersion(validVersionOrRange)
7575
.then(resultVersion => packageToInstall + '@' + resultVersion);
7676
} else {
7777
return Promise.resolve(version);

0 commit comments

Comments
 (0)