ripple-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [3/3] incubator-ripple git commit: Fix RIPPLE-93.
Date Wed, 15 Jul 2015 01:19:15 GMT
Fix RIPPLE-93.

When emulating locally, change current working directory to the project path
specified by --path.

This closes #65


Project: http://git-wip-us.apache.org/repos/asf/incubator-ripple/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ripple/commit/ba38300b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ripple/tree/ba38300b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ripple/diff/ba38300b

Branch: refs/heads/master
Commit: ba38300b0ac3a118543ebe8bfe5b4ba52b0b4514
Parents: 5fcf93a
Author: Arzhan Kinzhalin <arzhan.i.kinzhalin@intel.com>
Authored: Wed Jul 15 11:16:19 2015 +1000
Committer: Tim Barham <tim.barham@microsoft.com>
Committed: Wed Jul 15 11:16:45 2015 +1000

----------------------------------------------------------------------
 lib/server/emulate.js | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ripple/blob/ba38300b/lib/server/emulate.js
----------------------------------------------------------------------
diff --git a/lib/server/emulate.js b/lib/server/emulate.js
index a94f960..2718912 100644
--- a/lib/server/emulate.js
+++ b/lib/server/emulate.js
@@ -33,7 +33,16 @@ module.exports = {
     start: function (options) {
         var app = server.start(options);
 
-        if (!options.path) { options.path = [process.cwd()]; }
+        if (!options.path) {
+            options.path = [process.cwd()];
+        } else {
+            try {
+                process.chdir(options.path[0]);
+            } catch (err) {
+                console.error('Cannot cd to the project directory:'.red.bold, err.toString());
+                process.exit(1);
+            }
+        }
 
         if (!options.route) {
             options.route = "/ripple";


Mime
View raw message