Skip to content
Permalink
Browse files
CB-13471: Fix tests and path issues for Windows
  • Loading branch information
raphinesse authored and dpogue committed May 7, 2018
1 parent f5b1cd2 commit 5bc0764161a1ca9f2131f01b7b8887eb26b2c1a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
@@ -82,4 +82,10 @@ describe('ConfigFile tests', function () {
var configPath = path.join('project_dir', 'app', 'src', 'main', file, 'xml');
expect(configFile.resolveConfigFilePath('project_dir', 'android', file)).toBe(configPath);
});

it('resolveConfigFilePath should return file path', function () {
var file = 'res/xml';
var configPath = path.join('project_dir', 'app', 'src', 'main', file, 'xml');
expect(configFile.resolveConfigFilePath('project_dir', 'android', file)).toBe(configPath);
});
});
@@ -166,6 +166,8 @@ function resolveConfigFilePath (project_dir, platform, file) {
var filepath = path.join(project_dir, file);
var matches;

file = path.normalize(file);

if (file.indexOf('*') > -1) {
// handle wildcards in targets using glob.
matches = modules.glob.sync(path.join(project_dir, '**', file));
@@ -195,7 +197,7 @@ function resolveConfigFilePath (project_dir, platform, file) {
} else if (file.endsWith('strings.xml')) {
// Plugins really shouldn't mess with strings.xml, since it's able to be localized
filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'values', 'strings.xml');
} else if (file.match(/res\/xml/)) {
} else if (file.includes(path.join('res', 'xml'))) {
// Catch-all for all other stored XML configuration in legacy plugins
var config_file = path.basename(file);
filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'xml', config_file);

0 comments on commit 5bc0764

Please sign in to comment.