[ 
https://issues.apache.org/jira/browse/CB-12592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15955698#comment-15955698
 ] 

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_r109757692
  
    --- Diff: cordova-lib/src/cordova/platform.js ---
    @@ -410,11 +409,10 @@ function getPlatformDetailsFromDir(dir, 
platformIfKnown){
     
         try {
             var pkgPath = path.join(libDir, 'package.json');
    -        delete require.cache[pkgPath];
    -        var pkg = require(pkgPath);
    +        var pkg = cordova_util.requireNoCache(pkgPath);
             platform = platformFromName(pkg.name);
             version = pkg.version;
    -        delete require.cache[pkgPath];
    +        cordova_util.requireNoCache(pkgPath);
    --- End diff --
    
    Don't think this is needed


> 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]

Reply via email to