You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/09/09 21:37:40 UTC

android commit: Make version in version script easier to replace by coho

Updated Branches:
  refs/heads/master 80a09b8f3 -> 1bfcc9267


Make version in version script easier to replace by coho


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/1bfcc926
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/1bfcc926
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/1bfcc926

Branch: refs/heads/master
Commit: 1bfcc9267719bbf1fbab399e6e8e8390f69819d6
Parents: 80a09b8
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Sep 9 15:37:00 2013 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Sep 9 15:37:00 2013 -0400

----------------------------------------------------------------------
 bin/templates/cordova/lib/version.js | 53 -------------------------------
 bin/templates/cordova/version        | 14 ++------
 2 files changed, 3 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/1bfcc926/bin/templates/cordova/lib/version.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/version.js b/bin/templates/cordova/lib/version.js
deleted file mode 100644
index f28b672..0000000
--- a/bin/templates/cordova/lib/version.js
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env node
-
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-
-var shell = require('shelljs'),
-    fs    = require('fs'),
-    path  = require('path'),
-    ROOT = path.join(__dirname, '..', '..');
-
-/*
- * Displays the version, gotten from cordova.js
- */
-module.exports.run = function() {
-    var cordovajs_path = path.join(ROOT, 'assets', 'www', 'cordova.js');
-    if (fs.existsSync(cordovajs_path)) {
-        var version_line = shell.grep(/^.*CORDOVA_JS_BUILD_LABEL.*$/, cordovajs_path);
-        var version = version_line.match(/(\d+)\.(\d+)\.(\d+)(rc\d)?/)[0];
-        if (version) {
-            console.log(version);
-            return version;
-        } else {
-            console.error("ERROR : Unable to find version in cordova.js");
-            process.exit(2);
-        }
-    } else {
-        console.error("ERROR : Could not find cordova.js");
-        console.error('Expected Location : ' + cordovajs_path);
-        process.exit(2);
-    }
-}
-
-module.exports.help = function() {
-    console.log('Usage: ' + path.relative(process.cwd(), path.join(ROOT, 'corodva', 'version')));
-    console.log('Returns the version of Cordova.');
-    process.exit(0);
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-android/blob/1bfcc926/bin/templates/cordova/version
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/version b/bin/templates/cordova/version
index 1b9dbf6..04e734c 100755
--- a/bin/templates/cordova/version
+++ b/bin/templates/cordova/version
@@ -19,15 +19,7 @@
        under the License.
 */
 
-var version = require('./lib/version');
-var args  = process.argv;
+// Coho updates this line:
+var VERSION = '3.1.0-dev';
 
-// Usage support for when args are given
-if(args.length > 2) {
-    version.help();
-} else {
-    // TODO : Don't have this hardcoded into the scripts
-    console.log('3.1.0-dev');
-    //console.log(version.run());
-    process.exit(0);
-}
\ No newline at end of file
+console.log(VERSION);