Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 606651150A for ; Wed, 23 Apr 2014 13:36:16 +0000 (UTC) Received: (qmail 99181 invoked by uid 500); 23 Apr 2014 13:36:16 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 99149 invoked by uid 500); 23 Apr 2014 13:36:15 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 99136 invoked by uid 99); 23 Apr 2014 13:36:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Apr 2014 13:36:15 +0000 Date: Wed, 23 Apr 2014 13:36:15 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-5833) --copy-from and --link-to should work when pointed to a dir that contains a www/ and config.xml MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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)