[
https://issues.apache.org/jira/browse/CB-12592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15955701#comment-15955701
]
ASF GitHub Bot commented on CB-12592:
-------------------------------------
Github user stevengill commented on a diff in the pull request:
https://github.com/apache/cordova-lib/pull/536#discussion_r109752953
--- Diff: cordova-lib/src/cordova/platform.js ---
@@ -154,8 +154,9 @@ function addHelper(cmd, hooksRunner, projectRoot,
targets, opts) {
return downloadPlatform(projectRoot, platform, spec, opts);
}).then(function(platDetails) {
if(fs.existsSync(path.join(projectRoot, 'package.json'))) {
- delete
require.cache[require.resolve(path.join(projectRoot, 'package.json'))];
+ pkgJson =
cordova_util.requireNoCache(path.join(projectRoot, 'package.json'));
--- End diff --
I think this line + if statement can be deleted too
> Refactor and add delete require.cache to cordova_util and create pkgManager
> ---------------------------------------------------------------------------
>
> Key: CB-12592
> URL: https://issues.apache.org/jira/browse/CB-12592
> Project: Apache Cordova
> Issue Type: Improvement
> Components: cordova-lib
> Reporter: Audrey So
> Assignee: Audrey So
> Priority: Minor
> Labels: 7.0.0
>
> There are 120 instances of delete require.cache in cordova-lib. It should be
> refactored and added to cordova_util so it can be reused when needed. Package
> manager should also be created to load and save pkgJson files. Package
> manager loads files without require so that there is never a cache and saves
> stringified object to file.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]