Skip to content

Commit 3442698

Browse files
openUmbrellalisong
authored andcommitted
修改由于 code-push 的 release 命令发布热更新可能导致hash值不同bug (#236)
3q
1 parent 6fd2da1 commit 3442698

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/utils/security.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ security.packageHashSync = function (jsonData) {
6969
log.debug('packageHashSync manifestData:', manifestData);
7070
var manifestString = JSON.stringify(manifestData.sort());
7171
manifestString = _.replace(manifestString, /\\\//g, '/');
72-
log.debug('packageHashSync manifestString:', manifestData);
72+
log.debug('packageHashSync manifestString:', manifestString);
7373
return security.stringSha256Sync(manifestString);
7474
}
7575

@@ -202,6 +202,10 @@ security.calcAllFileSha256 = function (directoryPath) {
202202
var data = {};
203203
_.forIn(results, (value, key) => {
204204
var relativePath = path.relative(directoryPath, key);
205+
var matchresult = relativePath.match(/(\/|\\).*/);
206+
if (matchresult) {
207+
relativePath = path.join('CodePush', matchresult[0]);
208+
}
205209
relativePath = slash(relativePath);
206210
data[relativePath] = value;
207211
});

0 commit comments

Comments
 (0)