You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/01/09 20:06:58 UTC

[jira] [Commented] (CB-12337) 'cordova emulate' errors if path contains symlink on Windows

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

ASF GitHub Bot commented on CB-12337:
-------------------------------------

GitHub user sryze opened a pull request:

    https://github.com/apache/cordova-lib/pull/514

    CB-12337 Resolve symbolic links in project root

    ### Platforms affected
    All?
    
    ### What does this PR do?
    
    If project path had symlinks its absolute value was different from that returned by `__dirname` inside project-local modules. So when it was joined with various dirs like `www` the two absolute paths were merged resulting in an invalid path.
    
    This should make commands like `cordova emulate android` work on Windows for projects with symlinks in path.
    
    There may be other places where similar measures need to be taken.
    
    ### What testing has been done on this change?
    Tested locally on my project.
    
    ### Checklist
    - [X] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
    - [X] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
    - [ ] Added automated test coverage as appropriate for this change.


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

    $ git pull https://github.com/sryze/cordova-lib cb-12337

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

    https://github.com/apache/cordova-lib/pull/514.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 #514
    
----
commit dff7e78ddf87d90c09a9fd265b76e083cbf45869
Author: Sergey Zolotarev <sr...@yandex.com>
Date:   2017-01-09T19:51:57Z

    CB-12337 Resolve symbolic links in project root
    
    If project path had symlinks its absolute value was different from that
    returned by __dirname inside project-local modules. So when it was joined
    with various dirs like 'www' the two absolute paths were merged resulting
    in an invalid path.
    
    This should make 'cordova emulate android' work on Windows for projects
    with symlinks in path.
    
    There may be other places where similar measures need to be taken.

----


> 'cordova emulate' errors if path contains symlink on Windows
> ------------------------------------------------------------
>
>                 Key: CB-12337
>                 URL: https://issues.apache.org/jira/browse/CB-12337
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CLI, Windows
>    Affects Versions: 6.4.0
>         Environment: Windows 10 x64
>            Reporter: Sergey Zolotarev
>            Priority: Minor
>              Labels: win64
>
> If you are inside a directory that was entered via a symlink (created via mklink /D on Windows) cordova emulate android will fail with the following error:
> Error: Source directory does not exist: C:\Users\szx\Work\Projects\MyProject\E:\Work\Projects\MyProject\platforms\android\platform_www
> Here `C:\Users\szx\Work` is a symlink to `E:\Work`.
> It looks like it concatenate the source and destination paths.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org