[ 
https://issues.apache.org/jira/browse/CB-14099?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16524574#comment-16524574
 ] 

ASF GitHub Bot commented on CB-14099:
-------------------------------------

tripodsan closed pull request #32: CB-14099 osx: Fixed Resolve Config Path for 
OSX
URL: https://github.com/apache/cordova-common/pull/32
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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
@@ -72,6 +72,12 @@ describe('ConfigFile tests', function () {
         expect(configFile.resolveConfigFilePath('project_dir', 'ios', 
'config.xml')).toBe(configPath);
     });
 
+    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'));


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Cordova OSX - Apps not working with Plugins
> -------------------------------------------
>
>                 Key: CB-14099
>                 URL: https://issues.apache.org/jira/browse/CB-14099
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-common, cordova-osx
>         Environment: Cordova 8.0
> osx "El capitan"
>  
>            Reporter: Jose Antonio Silva Korhonen
>            Assignee: Tobias Bocanegra
>            Priority: Major
>             Fix For: Master
>
>
> It's not possible to get any app with any compatible plugins working on osx.
> 1 - Create a barebone Cordova App
>  * cordova create myapp org.apache.myapp myapp
> 2 - Add osx platform
>  * cordova platform add osx
> 3 - Add any plugin compatible with osx, for example cordova-plugin-file
>  * cordova plugin add cordova-plugin-file
> 4 - Run the App
>  * cordova run osx
> 5 - The App doesn't trigger "device ready"
>   The app stays on the state "CONNECTING TO DEVICE" for ever.
>   It's expect that is shown "DEVICE IS READY". If you remove all plugins from 
> the app then "DEVICE IS READY" is shown
>  
> On older versions of cordova osx this procedure worked.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to