mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-05-14 02:14:52 +08:00
Flow type checking fix: use "CodePushHash" file name instead of "CodePushHash.json" (#763)
`CodePushHash.json` file name breaks flow type checking. To fix the issue we need to delete `CodePushHash.json` file and use `CodePushHash` file name instead to store the hash value. Relates to https://github.com/Microsoft/react-native-code-push/issues/577
This commit is contained in:
committed by
Richard Hua
parent
80210059b0
commit
2b02ce90ef
@@ -18,7 +18,8 @@ var path = require("path");
|
||||
var getFilesInFolder = require("./getFilesInFolder");
|
||||
|
||||
var CODE_PUSH_FOLDER_PREFIX = "CodePush";
|
||||
var CODE_PUSH_HASH_FILE_NAME = "CodePushHash.json";
|
||||
var CODE_PUSH_HASH_FILE_NAME = "CodePushHash";
|
||||
var CODE_PUSH_HASH_OLD_FILE_NAME = "CodePushHash.json";
|
||||
var HASH_ALGORITHM = "sha256";
|
||||
var TEMP_FILE_PATH = path.join(require("os").tmpdir(), "CodePushResourcesMap.json");
|
||||
|
||||
@@ -72,6 +73,15 @@ function addJsBundleAndMetaToManifest() {
|
||||
|
||||
var savedResourcesManifestPath = assetsDir + "/" + CODE_PUSH_HASH_FILE_NAME;
|
||||
fs.writeFileSync(savedResourcesManifestPath, finalHash);
|
||||
|
||||
// "CodePushHash.json" file name breaks flow type checking.
|
||||
// To fix the issue we need to delete "CodePushHash.json" file and
|
||||
// use "CodePushHash" file name instead to store the hash value.
|
||||
// Relates to https://github.com/Microsoft/react-native-code-push/issues/577
|
||||
var oldSavedResourcesManifestPath = assetsDir + "/" + CODE_PUSH_HASH_OLD_FILE_NAME;
|
||||
if (fs.existsSync(oldSavedResourcesManifestPath)) {
|
||||
fs.unlinkSync(oldSavedResourcesManifestPath);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user