Cscott has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/177116

Change subject: Use a consistent version number in all of the CLI scripts.
......................................................................

Use a consistent version number in all of the CLI scripts.

Change-Id: I11bde8a73921ff37580025f0c3008f408f91f601
---
M lib/cli.js
M mw-ocg-service.js
M scripts/clear-queue.js
M scripts/loadtest.js
M scripts/run-garbage-collect.js
5 files changed, 10 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection/OfflineContentGenerator
 refs/changes/16/177116/1

diff --git a/lib/cli.js b/lib/cli.js
index fdee5ba..539bdfc 100644
--- a/lib/cli.js
+++ b/lib/cli.js
@@ -1,6 +1,8 @@
 // common code for cli scripts.
 "use strict";
 
+var json = require( '../package.json' );
+
 var fs = require( 'fs' ),
        path = require( 'path' ),
        assert = require( 'assert' );
@@ -107,3 +109,5 @@
                config.reporting.enable
        ));
 };
+
+exports.version = json.version;
diff --git a/mw-ocg-service.js b/mw-ocg-service.js
index b6220f0..c933d10 100755
--- a/mw-ocg-service.js
+++ b/mw-ocg-service.js
@@ -39,7 +39,7 @@
 
 // parse command-line options (with a possible additional config file override)
 commander
-       .version( '0.0.1' )
+       .version( cli.version )
        .option( '-c, --config <path>', 'Path to the local configuration file' )
        .parse( process.argv );
 
diff --git a/scripts/clear-queue.js b/scripts/clear-queue.js
index 4356a4e..0e1103c 100755
--- a/scripts/clear-queue.js
+++ b/scripts/clear-queue.js
@@ -38,7 +38,7 @@
 var redisClient = null;
 
 commander
-       .version( '0.0.1' )
+       .version( cli.version )
        .option( '-c, --config <path>', 'Path to the local configuration file' )
        .parse( process.argv );
 
diff --git a/scripts/loadtest.js b/scripts/loadtest.js
index 2957e04..cb4047f 100755
--- a/scripts/loadtest.js
+++ b/scripts/loadtest.js
@@ -10,8 +10,10 @@
 var path = require('path');
 var request = Promise.promisify(require('request'), true);
 
+var cli = require( '../lib/cli.js' );
+
 program
-       .version('1.0.0')
+       .version( cli.version )
        .usage('[options] [pages.list]')
        .option('-a, --api <url>',
                        // `ssh -L 17080:ocg.svc.eqiad.wmnet:8000 tin` might be 
handy!
diff --git a/scripts/run-garbage-collect.js b/scripts/run-garbage-collect.js
index 962af05..7ff96c2 100755
--- a/scripts/run-garbage-collect.js
+++ b/scripts/run-garbage-collect.js
@@ -35,7 +35,7 @@
 
 // parse command-line options (with a possible additional config file override)
 commander
-       .version( '0.0.1' )
+       .version( cli.version )
        .option( '-c, --config <path>', 'Path to the local configuration file' )
        .parse( process.argv );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/177116
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I11bde8a73921ff37580025f0c3008f408f91f601
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to