You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2017/06/06 05:43:14 UTC

[08/24] cordova-serve git commit: CB-9546 cordova-serve.servePlatform() should provide project folders

CB-9546 cordova-serve.servePlatform() should provide project folders

The 'servePlatform()' method provided by 'cordova-serve' figures out the project and platform root directories (either from the cwd or a provided path). Since this information is potentially useful to the caller, it is now provided in the return value.


Project: http://git-wip-us.apache.org/repos/asf/cordova-serve/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-serve/commit/b2da558f
Tree: http://git-wip-us.apache.org/repos/asf/cordova-serve/tree/b2da558f
Diff: http://git-wip-us.apache.org/repos/asf/cordova-serve/diff/b2da558f

Branch: refs/heads/master
Commit: b2da558f730bfd0ff0455f4f84de3bd91849b00b
Parents: 9c2ee8b
Author: Tim Barham <ti...@microsoft.com>
Authored: Sat Aug 22 18:48:30 2015 +1000
Committer: Tim Barham <ti...@microsoft.com>
Committed: Sat Aug 22 18:51:20 2015 +1000

----------------------------------------------------------------------
 src/platform.js | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-serve/blob/b2da558f/src/platform.js
----------------------------------------------------------------------
diff --git a/src/platform.js b/src/platform.js
index 12b169b..940b71b 100644
--- a/src/platform.js
+++ b/src/platform.js
@@ -37,12 +37,17 @@ module.exports = function (platform, opts) {
         }
 
         opts = opts || {};
-        opts.root = util.getPlatformWwwRoot(findProjectRoot(opts.root), platform);
+        var projectRoot = findProjectRoot(opts.root);
+        var platformRoot = opts.root = util.getPlatformWwwRoot(projectRoot, platform);
         if (!fs.existsSync(opts.root)) {
             throw new Error('Project does not include the specified platform: ' + platform);
         }
 
-        return server(opts);
+        return server(opts).then(function (serverInfo) {
+            serverInfo.projectRoot = projectRoot;
+            serverInfo.platformRoot = platformRoot;
+            return serverInfo;
+        });
     });
 };
 


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