This is an automated email from the ASF dual-hosted git repository.
tripod pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-common.git
The following commit(s) were added to refs/heads/master by this push:
new 7bf9627 CB-14099 osx: Fixed Resolve Config Path for OSX
7bf9627 is described below
commit 7bf9627f0135c6b3518292660b6e07e6f5815926
Author: エリス <[email protected]>
AuthorDate: Tue Jun 26 18:57:41 2018 +0900
CB-14099 osx: Fixed Resolve Config Path for OSX
This closes #32
---
spec/ConfigChanges/ConfigFile.spec.js | 6 ++++++
src/ConfigChanges/ConfigFile.js | 11 +++++++----
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/spec/ConfigChanges/ConfigFile.spec.js
b/spec/ConfigChanges/ConfigFile.spec.js
index 98b1d98..c693420 100644
--- a/spec/ConfigChanges/ConfigFile.spec.js
+++ b/spec/ConfigChanges/ConfigFile.spec.js
@@ -73,6 +73,12 @@ describe('ConfigFile tests', function () {
});
it('resolveConfigFilePath should return file path', function () {
+ spyOn(configFile, 'getIOSProjectname').and.returnValue('osxpath');
+ var configPath = path.join('project_dir', 'osxpath', 'config.xml');
+ expect(configFile.resolveConfigFilePath('project_dir', 'osx',
'config.xml')).toBe(configPath);
+ });
+
+ it('resolveConfigFilePath should return file path', function () {
var configPath = path.join('project_dir', 'config.xml');
expect(configFile.resolveConfigFilePath('project_dir', 'ubuntu',
'config.xml')).toBe(configPath);
});
diff --git a/src/ConfigChanges/ConfigFile.js b/src/ConfigChanges/ConfigFile.js
index 0b2a23b..a42c06b 100644
--- a/src/ConfigChanges/ConfigFile.js
+++ b/src/ConfigChanges/ConfigFile.js
@@ -211,9 +211,12 @@ function resolveConfigFilePath (project_dir, platform,
file) {
if (file === 'config.xml') {
if (platform === 'ubuntu') {
filepath = path.join(project_dir, 'config.xml');
- } else if (platform === 'ios') {
- var iospath = module.exports.getIOSProjectname(project_dir);
- filepath = path.join(project_dir, iospath, 'config.xml');
+ } else if (platform === 'ios' || platform === 'osx') {
+ filepath = path.join(
+ project_dir,
+ module.exports.getIOSProjectname(project_dir),
+ 'config.xml'
+ );
} else {
matches = modules.glob.sync(path.join(project_dir, '**',
'config.xml'));
if (matches.length) filepath = matches[0];
@@ -225,7 +228,7 @@ function resolveConfigFilePath (project_dir, platform,
file) {
return filepath;
}
-// Find out the real name of an iOS project
+// Find out the real name of an iOS or OSX project
// TODO: glob is slow, need a better way or caching, or avoid using more than
once.
function getIOSProjectname (project_dir) {
var matches = modules.glob.sync(path.join(project_dir, '*.xcodeproj'));
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]