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 3CE8D11BEE for ; Mon, 21 Apr 2014 17:39:42 +0000 (UTC) Received: (qmail 59830 invoked by uid 500); 21 Apr 2014 17:39:41 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 59791 invoked by uid 500); 21 Apr 2014 17:39:41 -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 59783 invoked by uid 500); 21 Apr 2014 17:39:41 -0000 Delivered-To: apmail-incubator-callback-dev@incubator.apache.org Received: (qmail 59779 invoked by uid 99); 21 Apr 2014 17:39:41 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Apr 2014 17:39:41 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id C3E0998E7DE; Mon, 21 Apr 2014 17:39:40 +0000 (UTC) From: cmarcelk To: callback-dev@incubator.apache.org Reply-To: callback-dev@incubator.apache.org References: In-Reply-To: Subject: [GitHub] cordova-mobile-spec pull request: CB-6437[Improvements & support f... Content-Type: text/plain Message-Id: <20140421173940.C3E0998E7DE@tyr.zones.apache.org> Date: Mon, 21 Apr 2014 17:39:40 +0000 (UTC) Github user cmarcelk commented on a diff in the pull request: https://github.com/apache/cordova-mobile-spec/pull/55#discussion_r11816596 --- Diff: createmobilespec/createmobilespec.js --- @@ -17,99 +16,197 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -*/ + */ -var fs = require('fs'), - path = require('path'), +var fs = require("fs"), + path = require("path"), + child_process = require("child_process"), shelljs, optimist; + +// Dependencies requirements check try { - shelljs = require('shelljs'); - optimist = require('optimist'); + shelljs = require("shelljs"); + optimist = require("optimist"); } catch (e) { - console.error('Missing module. Please run "npm install" from this directory:\n\t' + + console.error('Missing module. Please run \"npm install\" from this directory:\n\t' + path.dirname(__dirname)); process.exit(2); } - -var tokens = process.argv.slice(2); -var argv = optimist(tokens) - .default('android', false) - .default('ios', false) - .usage('Usage: $0 [--android] [--ios]\nDefault is to use Android and iOS.') - .argv; -// preserve the original behavior when there are no args -if (tokens.length === 0) { - argv.android = true; - argv.ios = true; +// Print relevant information +console.log("Creating \"mobilespec\" project. If you have any errors, it may be from missing repositories."); +console.log("To clone needed repositories:"); +console.log(" ./cordova-coho/coho repo-clone -r plugins -r mobile-spec -r android -r ios -r cli"); +console.log("To update all repositories:"); +console.log(" ./cordova-coho/coho repo-update"); + +// Setting up vars, folders and libraries, to ensure full compatibility cross platform, absolute paths are used instead of relative paths + +// Cordova Coho dir, it should contain all libraries and required repositories +// [cordova-cli, cordova-android, cordova-blackberry, cordova-ios, cordova-windows, cordova-windows8, all plugins libraries, cordova-mobile-spec, cordova-js] +// searchDir function it was added, to look for cordova-coho folder backwards, for cases like absolute/path/cordova-coho/cordova-coho/...All libraries +// This is to make sure that cordova-coho exists and it's the right one. +var mainModDir = process.cwd(), + coho_dir = searchDir(mainModDir, "cordova-coho"), + cordova_cli = path.join(coho_dir, "cordova-cli", "bin", "cordova"), + cordova_ms = path.join(coho_dir, "cordova-mobile-spec"), + cordova_js = path.join(coho_dir, "cordova-js"), + ms_project_dir = path.join(coho_dir, "mobilespec"), + platforms = [], +//Setting up optimist features + tokens = process.argv.slice(2), + argv = optimist(tokens) + .usage("Usage: $0 [--platform].") --- End diff -- Could you spell out what specific arguments are possible here instead of just a generic? Including "--help"? --- 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. ---