[
https://issues.apache.org/jira/browse/CB-5833?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13978191#comment-13978191
]
ASF GitHub Bot commented on CB-5833:
------------------------------------
Github user mmocny commented on a diff in the pull request:
https://github.com/apache/cordova-cli/pull/169#discussion_r11900004
--- Diff: src/create.js ---
@@ -124,9 +129,22 @@ module.exports = function create (dir, id, name, cfg) {
}
// Keep going into child "www" folder if exists in stock app
package.
while (fs.existsSync(path.join(www_lib, 'www'))) {
+ www_parent_dir = www_lib;
www_lib = path.join(www_lib, 'www');
}
+ // Find if we also have custom merges and config.xml as siblings
of custom www.
+ if (www_parent_dir && config_json.lib && config_json.lib.www) {
+ custom_config_xml = path.join(www_parent_dir, 'config.xml');
+ if ( !fs.existsSync(custom_config_xml) ) {
+ custom_config_xml = '';
--- End diff --
I prefer null to empty string for these failure cases. Empty string tests
false in if statements, but is a valid input for others.
> --copy-from and --link-to should work when pointed to a dir that contains a
> www/ and config.xml
> -----------------------------------------------------------------------------------------------
>
> Key: CB-5833
> URL: https://issues.apache.org/jira/browse/CB-5833
> Project: Apache Cordova
> Issue Type: Bug
> Components: CLI
> Reporter: Andrew Grieve
> Assignee: Mark Koudritsky
> Priority: Minor
>
> The recently added --source and --link flags allow you to create a project
> given its www/. It would be even more useful to be able to create a project
> using a dir that contains config.xml, merges/ and www/.
--
This message was sent by Atlassian JIRA
(v6.2#6252)