Skip to content

Commit

Permalink
Plain integer number (#429)
Browse files Browse the repository at this point in the history
* Improved messages to make intention of creating different apps for different platforms more clear

Due to multiple requests in discord chanel, microsoft/react-native-code-push#723, microsoft/react-native-code-push#717

* Minor tweak for readme

* Add ability to use plain integer number for app version

See #377 for details
  • Loading branch information
Max committed Jul 19, 2017
1 parent bd905f8 commit c5a294d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ The following table outlines the version value that CodePush expects your update
| React Native (iOS) | The `CFBundleShortVersionString` key in the `Info.plist` file |
| React Native (Windows) | The `<Identity Version>` key in the `Package.appxmanifest` file |

*NOTE: If the app store version in the metadata files are missing a patch version, e.g. `2.0`, it will be treated as having a patch version of `0`, i.e. `2.0 -> 2.0.0`.*
*NOTE: If the app store version in the metadata files are missing a patch version, e.g. `2.0`, it will be treated as having a patch version of `0`, i.e. `2.0 -> 2.0.0`. The same is true for app store version equal to plain integer number, `1` will be treated as `1.0.0` in this case.*

#### Deployment name parameter

Expand Down
4 changes: 3 additions & 1 deletion cli/script/command-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,9 @@ function getReactNativeProjectAppVersion(command: cli.IReleaseReactCommand, proj
catch (e) { return false }
};

const isValidVersion = (version: string): boolean => !!semver.valid(version) || /^\d+\.\d+$/.test(version);
// Allow plain integer versions (as well as '1.0' values) for now, e.g. '1' is valid here and we assume that it is equal to '1.0.0'.
// (missing minor/patch values will be added on server side to pass semver.satisfies check)
const isValidVersion = (version: string): boolean => !!semver.valid(version) || /^\d+\.\d+$/.test(version) || /^\d+$/.test(version);

log(chalk.cyan(`Detecting ${command.platform} app version:\n`));

Expand Down

0 comments on commit c5a294d

Please sign in to comment.