-
Notifications
You must be signed in to change notification settings - Fork 6
Cordova support, Code-push App Name , Update dependencies #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
bd5a04d
d89a1be
f4c91c9
bb5a5f0
68555b7
ed62c58
f167a38
977da5c
6eae229
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ node_modules/ | |
npm-debug.log | ||
lib/ | ||
coverage/ | ||
.nyc* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import codepushLogin from "./steps/login"; | ||
import codepushReleaseReact from "./steps/release-react"; | ||
import codePushRelease from "./steps/release-react"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The file name should be modified, maybe in release.js, because it is also for cordova release |
||
import codepushLogout from "./steps/logout"; | ||
|
||
export default function codePushTravis (argv) { | ||
|
@@ -8,7 +8,7 @@ export default function codePushTravis (argv) { | |
) && process.env.TRAVIS_PULL_REQUEST === "false") { | ||
const pkg = require(`${process.env.TRAVIS_BUILD_DIR}/package.json`); | ||
codepushLogin(); | ||
argv.platforms.forEach(platform => codepushReleaseReact(argv, platform, pkg)); | ||
argv.platforms.forEach(platform => codePushRelease(argv, platform, pkg)); | ||
codepushLogout(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,34 +4,43 @@ function targetBinary (targetBinary) { | |
return targetBinary ? `-t "${targetBinary}"` : ""; | ||
} | ||
|
||
function appName (pkgName, platform) { | ||
function appName (pkgName, platform, argv) { | ||
|
||
if (argv.na && platform === "android") { | ||
return `"${argv.na}"`; | ||
} | ||
|
||
if (argv.ni && platform === "ios") { | ||
return `"${argv.ni}"`; | ||
} | ||
|
||
return `"${pkgName}-${platform}"`; | ||
} | ||
|
||
function reactNativeRelease (argv, platform, pkg) { | ||
function codePushFrameworkRelease (argv, platform, pkg) { | ||
return [ | ||
"code-push", | ||
"release-react", | ||
appName(pkg.name, platform), | ||
(!argv.framework || argv.framework === "reactnative") ? "release-react" : "release-cordova", | ||
appName(pkg.name, platform, argv), | ||
platform, | ||
`-d "${argv.deploymentName}"`, | ||
`--des "${argv.description}"`, | ||
`--dev ${argv.development}`, | ||
(!argv.framework || argv.framework === "reactnative") ? `--dev ${argv.development}` : "", | ||
`-m ${argv.mandatory}`, | ||
targetBinary(argv.targetBinary) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It could be transform as the line of the development option, to mantain uniformity of the codebase |
||
].join(" "); | ||
} | ||
|
||
function reactNativeReleaseStatus (pkgName, platform) { | ||
function codePushFrameworkReleaseStatus (argv, pkgName, platform) { | ||
return [ | ||
"code-push", | ||
"deployment", | ||
"list", | ||
appName(pkgName, platform) | ||
appName(pkgName, platform, argv) | ||
].join(" "); | ||
} | ||
|
||
export default function codepushReleaseReact (argv, platform, pkg) { | ||
execSync(reactNativeRelease(argv, platform, pkg), {stdio: [0, 1, 2]}); | ||
execSync(reactNativeReleaseStatus(pkg.name, platform), {stdio: [0, 1, 2]}); | ||
export default function codePushRelease (argv, platform, pkg) { | ||
execSync(codePushFrameworkRelease(argv, platform, pkg), {stdio: [0, 1, 2]}); | ||
execSync(codePushFrameworkReleaseStatus(argv, pkg.name, platform), {stdio: [0, 1, 2]}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
na option is not an auto-explanatory alias, so it could be only nameAndroid without alias? The same is for ni and nameIos