cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agrieve <...@git.apache.org>
Subject [GitHub] cordova-lib pull request: CB-8239 Add support for git urls to 'cor...
Date Thu, 22 Jan 2015 20:52:01 GMT
Github user agrieve commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/148#discussion_r23408671
  
    --- Diff: cordova-lib/src/cordova/platform.js ---
    @@ -71,102 +72,98 @@ function add(hooksRunner, projectRoot, targets, opts) {
     
         // The "platforms" dir is safe to delete, it's almost equivalent to
         // cordova platform rm <list of all platforms>
    -    if ( !fs.existsSync(platformsDir)) {
    +    if (!fs.existsSync(platformsDir)) {
             shell.mkdir('-p', platformsDir);
         }
     
         return hooksRunner.fire('before_platform_add', opts)
    -    .then(function() {
    -        return promiseutil.Q_chainmap(targets, function(target) {
    +    .then(function () {
    +        return promiseutil.Q_chainmap(targets, function (target) {
                 // For each platform, download it and call its "create" script.
                 var parts = target.split('@');
                 var platform = parts[0];
                 var version = parts[1];
     
    -            return Q.when().then(function() {
    +            return Q.when().then(function () {
                     if (!(platform in platforms)) {
    -                    return getPlatformDetailsFromDir(target);
    -                } else {
    +                    // First, try handling 'platform' as a directory, if it fails, try
handling it as a git repository
    +                    return Q.fcall(function () {
    +                        return util.getPlatformDetailsFromDir(target);
    +                    }).fail(function (err) {
    +                        // Maybe it's a git repo
    --- End diff --
    
    Will this cause mistyped directory names to give an error message about git cloning not
working? Maybe first at least check if it is a valid URL before trying to clone it?


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


Mime
View raw message