You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by smistry-toushay <gi...@git.apache.org> on 2014/08/25 23:28:27 UTC

[GitHub] cordova-lib pull request: Add support for plugin symbolic links

GitHub user smistry-toushay opened a pull request:

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

    Add support for plugin symbolic links

    Useful in when developing a plugin, changes support both adding and uninstalling plugins.

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

    $ git pull https://github.com/smistry-toushay/cordova-lib plugin_symbolic_links

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

    https://github.com/apache/cordova-lib/pull/78.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 #78
    
----
commit b441ae2b9a2ecac8d6f75ec42d5f7079b2266220
Author: Sandeep Mistry <sa...@toushay.com>
Date:   2014-08-25T21:22:16Z

    add support for plugin symbolic links
    
    for both adding and uninstalling

----


---
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-lib pull request: Add support for plugin symbolic links

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

    https://github.com/apache/cordova-lib/pull/78#discussion_r17233889
  
    --- Diff: cordova-lib/src/plugman/uninstall.js ---
    @@ -104,7 +104,12 @@ module.exports.uninstallPlugin = function(id, plugins_dir, options) {
                 return Q();
             }
     
    -        shell.rm('-rf', plugin_dir);
    +        if (fs.lstatSync(plugin_dir).isSymbolicLink()) {
    --- End diff --
    
    @mbektchiev but it also recursively deletes the files inside the folder the symbolic link points to (observed this on OS X).


---
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-lib pull request: Add support for plugin symbolic links

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

    https://github.com/apache/cordova-lib/pull/78#discussion_r17232882
  
    --- Diff: cordova-lib/src/plugman/uninstall.js ---
    @@ -104,7 +104,12 @@ module.exports.uninstallPlugin = function(id, plugins_dir, options) {
                 return Q();
             }
     
    -        shell.rm('-rf', plugin_dir);
    +        if (fs.lstatSync(plugin_dir).isSymbolicLink()) {
    --- End diff --
    
    This check is not necessary. `shell.rm` already removes symbolic links correctly.
    See: https://github.com/arturadib/shelljs/blob/master/src/rm.js#L117


---
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-lib pull request: Add support for plugin symbolic links

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

    https://github.com/apache/cordova-lib/pull/78#discussion_r17243247
  
    --- Diff: cordova-lib/src/plugman/uninstall.js ---
    @@ -104,7 +104,12 @@ module.exports.uninstallPlugin = function(id, plugins_dir, options) {
                 return Q();
             }
     
    -        shell.rm('-rf', plugin_dir);
    +        if (fs.lstatSync(plugin_dir).isSymbolicLink()) {
    --- End diff --
    
    @smistry-toushay You're right, it seems that the referred to version of the shelljs module (`"shelljs": "0.1.x"`) is rather old and doesn't handle symlinks correctly. 
    
    I think that it would be better to upgrade to the latest version instead of working around the issues of the old one.


---
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-lib pull request: Add support for plugin symbolic links

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

    https://github.com/apache/cordova-lib/pull/78#discussion_r17245409
  
    --- Diff: cordova-lib/src/plugman/uninstall.js ---
    @@ -104,7 +104,12 @@ module.exports.uninstallPlugin = function(id, plugins_dir, options) {
                 return Q();
             }
     
    -        shell.rm('-rf', plugin_dir);
    +        if (fs.lstatSync(plugin_dir).isSymbolicLink()) {
    --- End diff --
    
    I implemented the option for plugman because it didn't work there also. Here's my pull request which also updates the shelljs library version: https://github.com/apache/cordova-lib/pull/85. 
    I verified that all unit tests pass and that it doesn't delete the target directory of a symbolic link - so you can safely remove this code, afterwards.


---
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-lib pull request: Add support for plugin symbolic links

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

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


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

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