Skip to content

Commit

Permalink
adaptor code-push 3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lisong committed Aug 24, 2019
1 parent 758a99a commit a0415ad
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
4 changes: 4 additions & 0 deletions core/services/client-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ proto.updateCheck = function(deploymentKey, appVersion, label, packageHash, clie
downloadUrl: "",
description: "",
isAvailable: false,
isDisabled: true,
isMandatory: false,
appVersion: appVersion,
targetBinaryRange: "",
packageHash: "",
label: "",
packageSize: 0,
Expand Down Expand Up @@ -178,9 +180,11 @@ proto.updateCheck = function(deploymentKey, appVersion, label, packageHash, clie
&& _.eq(packages.deployment_id, deploymentsVersions.deployment_id)
&& !_.eq(packages.package_hash, packageHash)) {
rs.packageId = packageId;
rs.targetBinaryRange = deploymentsVersions.app_version;
rs.downloadUrl = rs.downloadURL = common.getBlobDownloadUrl(_.get(packages, 'blob_url'));
rs.description = _.get(packages, 'description', '');
rs.isAvailable = _.eq(packages.is_disabled, 1) ? false : true;
rs.isDisabled = _.eq(packages.is_disabled, 1) ? true : false;
rs.isMandatory = _.eq(packages.is_mandatory, 1) ? true : false;
rs.appVersion = appVersion;
rs.packageHash = _.get(packages, 'package_hash', '');
Expand Down
22 changes: 11 additions & 11 deletions routes/indexV1.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ router.get('/update_check', (req, res, next) => {
delete rs.packageId;
delete rs.rollout;
var update_info = {
download_url : rs.downloadUrl;
description : rs.description;
is_available : rs.isAvailable;
is_disabled : rs.isDisabled;
target_binary_range: rs.targetBinaryRange;
label: rs.label;
package_hash: rs.packageHash;
package_size: rs.packageSize;
should_run_binary_version: rs.shouldRunBinaryVersion;
update_app_version: rs.updateAppVersion;
is_mandatory: rs.isMandatory;
download_url : rs.downloadUrl,
description : rs.description,
is_available : rs.isAvailable,
is_disabled : rs.isDisabled,
target_binary_range: rs.targetBinaryRange,
label: rs.label,
package_hash: rs.packageHash,
package_size: rs.packageSize,
should_run_binary_version: rs.shouldRunBinaryVersion,
update_app_version: rs.updateAppVersion,
is_mandatory: rs.isMandatory,
};
res.send({"update_info": update_info});
})
Expand Down

0 comments on commit a0415ad

Please sign in to comment.