Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 051FA11B19 for ; Fri, 28 Mar 2014 21:57:26 +0000 (UTC) Received: (qmail 59134 invoked by uid 500); 28 Mar 2014 21:57:25 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 59114 invoked by uid 500); 28 Mar 2014 21:57:25 -0000 Mailing-List: contact dev-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 dev@cordova.apache.org Received: (qmail 59101 invoked by uid 99); 28 Mar 2014 21:57:24 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Mar 2014 21:57:24 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id D273E915ABF; Fri, 28 Mar 2014 21:57:23 +0000 (UTC) From: martincgg To: dev@cordova.apache.org Reply-To: dev@cordova.apache.org References: In-Reply-To: Subject: [GitHub] cordova-cli pull request: CB-6329 improve 'cordova info' command Content-Type: text/plain Message-Id: <20140328215723.D273E915ABF@tyr.zones.apache.org> Date: Fri, 28 Mar 2014 21:57:23 +0000 (UTC) Github user martincgg commented on a diff in the pull request: https://github.com/apache/cordova-cli/pull/151#discussion_r11087542 --- Diff: src/info.js --- @@ -30,105 +29,80 @@ var cordova_util = require('./util'), Outputs to a file */ module.exports = function info() { - - //Get the template - var projectRoot = cordova_util.cdProjectRoot(); - - var raw = fs.readFileSync(path.join(__dirname, '..', 'doc', 'info.txt'), 'utf-8').split("\n"), - output; - - output = raw.map(function(line) { - if(line.match(' %') ) { - var type = (line.substr(5)).replace("\r",""), - out = ""; - - switch(type) { - case "Node": - out = shell.exec('node --version',{silent:true}).output; - break; - case "Cordova": - out = require('../package').version; - break; - case "Config": - out = fs.readFileSync( cordova_util.projectConfig(projectRoot) ); - break; - case "Platforms": - out = doPlatforms( projectRoot ); - break; - case "Plugins": - out = doPlugins( projectRoot ); - break; - default: - break; - } - return line.replace( "%"+type, out ); - } else { - return line; + //Get projectRoot + var projectRoot = cordova_util.cdProjectRoot(), + output; + delLog(projectRoot); + //Get Node info + info_utils.getNodeInfo(function (result){ + if( result ){ + print_SaveMsg(projectRoot, "Node version: "+ result); + //Get Cordova version + info_utils.getCordovaInfo(function (result){ + if( result ){print_SaveMsg(projectRoot,"Cordova version: "+ result ); + // Get config.xml file + fs.readFile(cordova_util.projectConfig(projectRoot) , 'utf-8' , function ( err , result ){ + if(err) {print_SaveMsg(projectRoot,"Error reading config.xml file"+ err);} + print_SaveMsg(projectRoot,'Config.xml File: \r'+ result +'\r\r\r'); + print_SaveMsg(projectRoot,'Plugins: \r' + doPlugins( projectRoot ) +'\r\r\r'); + //Get platforms info + doPlatforms(projectRoot, function (result){ + if( result ){ + print_SaveMsg(projectRoot,result); + } + }); + }); + } + }); } - }).join("\n"); - - // /* - // Write to File; - // */ - events.emit('results', output); - fs.writeFileSync('info.txt', output ); + }); return Q(); --- End diff -- Another way --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---