You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by surajpindoria <gi...@git.apache.org> on 2014/08/19 02:05:01 UTC

[GitHub] cordova-js pull request: CB-7332: Fixed Windows path issue when tr...

GitHub user surajpindoria opened a pull request:

    https://github.com/apache/cordova-js/pull/77

    CB-7332: Fixed Windows path issue when trying to set "navigator.app" in cordova.js

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/surajpindoria/cordova-js windowsBrowserify

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-js/pull/77.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #77
    
----
commit 826be56d2f94b0a6ca73a62949d043f96c0e6c4f
Author: Suraj Pindoria <su...@yahoo.com>
Date:   2014-08-18T23:36:06Z

    Fixed Windows path issue when trying to set "navigator.app" in cordova.js

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-js pull request: CB-7332: Fixed Windows path issue when tr...

Posted by purplecabbage <gi...@git.apache.org>.
Github user purplecabbage commented on a diff in the pull request:

    https://github.com/apache/cordova-js/pull/77#discussion_r16390788
  
    --- Diff: tasks/lib/require-tr.js ---
    @@ -86,7 +88,15 @@ function _updateRequires(code) {
         if(node instanceof UglifyJS.AST_Call) {
           // check if function call is a require('module') call
           if(node.expression.name === "require" && node.args.length === 1) {
    +
    +        // Uglify is not able to recognize Windows style paths using '\' instead of '/'
    +        // So replacing all of the '/' back to Windows '\'
    +        if (node.args[0].value != undefined && node.args[0].value.indexOf('c:') != -1) {
    --- End diff --
    
    this will only work on the c: drive, have you considered testing ```process.platform === 'win32'```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-js pull request: CB-7332: Fixed Windows path issue when tr...

Posted by surajpindoria <gi...@git.apache.org>.
Github user surajpindoria commented on a diff in the pull request:

    https://github.com/apache/cordova-js/pull/77#discussion_r16433602
  
    --- Diff: tasks/lib/require-tr.js ---
    @@ -86,7 +88,15 @@ function _updateRequires(code) {
         if(node instanceof UglifyJS.AST_Call) {
           // check if function call is a require('module') call
           if(node.expression.name === "require" && node.args.length === 1) {
    +
    +        // Uglify is not able to recognize Windows style paths using '\' instead of '/'
    +        // So replacing all of the '/' back to Windows '\'
    +        if (node.args[0].value !== undefined && node.args[0].value.indexOf('/android/app') !== -1 && process.platform === 'win32') {
    --- End diff --
    
    I have added the check for the Windows platform now.  I also removed the check for 'c:' and changed it to check for '/android/app'.  We need this here because in the code above, we are actually replacing code in the source file, so it needs to be changed back to appropriate Windows path.
    @purplecabbage 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-js pull request: CB-7332: Fixed Windows path issue when tr...

Posted by surajpindoria <gi...@git.apache.org>.
Github user surajpindoria closed the pull request at:

    https://github.com/apache/cordova-js/pull/77


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---