From f36acef1cfe744ea4cf5dfdc9bac7d6089a43ce6 Mon Sep 17 00:00:00 2001 From: Josh Thomas Date: Mon, 6 Jun 2016 11:34:48 -0500 Subject: [PATCH] fix(): ensure that the project base directory is passed to setupLiveReload. fixes #1034 --- lib/ionic/emulate.js | 4 ++-- lib/ionic/run.js | 4 ++-- spec/tasks/emulate.spec.js | 2 +- spec/tasks/run.spec.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/ionic/emulate.js b/lib/ionic/emulate.js index c54e0f6981..54319e32c4 100644 --- a/lib/ionic/emulate.js +++ b/lib/ionic/emulate.js @@ -67,11 +67,11 @@ function run(ionic, argv, rawCliArguments) { return Q.all(promiseList).then(function() { if (isLiveReload) { - return cordovaUtils.setupLiveReload(argv); + return cordovaUtils.setupLiveReload(argv, appDirectory); } // ensure the content node was set back to its original - return ConfigXml.setConfigXml(process.cwd(), { + return ConfigXml.setConfigXml(appDirectory, { resetContent: true, errorWhenNotFound: false }); diff --git a/lib/ionic/run.js b/lib/ionic/run.js index c03f6708ff..3897812818 100644 --- a/lib/ionic/run.js +++ b/lib/ionic/run.js @@ -67,11 +67,11 @@ function run(ionic, argv, rawCliArguments) { return Q.all(promiseList).then(function() { if (isLiveReload) { - return cordovaUtils.setupLiveReload(argv); + return cordovaUtils.setupLiveReload(argv, appDirectory); } // ensure the content node was set back to its original - return ConfigXml.setConfigXml(process.cwd(), { + return ConfigXml.setConfigXml(appDirectory, { resetContent: true, errorWhenNotFound: false }); diff --git a/spec/tasks/emulate.spec.js b/spec/tasks/emulate.spec.js index b0dc4bee9d..a4f3c71070 100644 --- a/spec/tasks/emulate.spec.js +++ b/spec/tasks/emulate.spec.js @@ -183,7 +183,7 @@ describe('emulate command', function() { spyOn(cordovaUtils, 'execCordovaCommand').andReturn(Q(true)); emulate.run(null, argv, rawCliArguments).then(function() { - expect(cordovaUtils.setupLiveReload).toHaveBeenCalledWith(argv); + expect(cordovaUtils.setupLiveReload).toHaveBeenCalledWith(argv. appDirectory); expect(cordovaUtils.execCordovaCommand).toHaveBeenCalledWith( ['emulate', 'android'], true, { blah: 'blah' }); done(); diff --git a/spec/tasks/run.spec.js b/spec/tasks/run.spec.js index 4935c8dc47..d57b3d0f4e 100644 --- a/spec/tasks/run.spec.js +++ b/spec/tasks/run.spec.js @@ -180,7 +180,7 @@ describe('run command', function() { })); run.run(null, argv, rawCliArguments).then(function() { - expect(cordovaUtils.setupLiveReload).toHaveBeenCalledWith(argv); + expect(cordovaUtils.setupLiveReload).toHaveBeenCalledWith(argv, appDirectory); expect(cordovaUtils.execCordovaCommand).toHaveBeenCalledWith( ['run', 'android'], true, { blah: 'blah' }); done();