File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed
Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,8 @@ command.prototype.bootstrap = function(plugin, callback) {
101101 cartoRef . setVersion ( mapnik . versions . mapnik ) ;
102102
103103 Bones . plugin . abilities = {
104+ // Get the unique version (from the VERSION file) that will be used in the parens in the heading
105+ // of the project settings page.
104106 version : ( function ( ) {
105107 try {
106108 return _ ( fs . readFileSync ( path . resolve ( __dirname + '/../VERSION' ) , 'utf8' ) . split ( '\n' ) ) . compact ( ) ;
Original file line number Diff line number Diff line change 1+ // Create the VERSION file which will be read by commands/core.bones to populate the unique version
2+ // in the heading of the project settings page.
13var exec = require ( 'child_process' ) . exec ;
24var fs = require ( 'fs' ) ;
35var package_json = require ( '../package.json' ) ;
@@ -9,8 +11,8 @@ var child = exec('git describe --tags --always',
911 } else {
1012 var hash = stdout ;
1113 if ( hash [ 0 ] == 'v' ) {
12- // git describe actually found a tag
13- var version_file = hash + hash . slice ( 1 , - 10 ) . replace ( '-' , '.' ) + '\n' ;
14+ //var version_file = hash + hash.slice(1, -10).replace('-', '.') + '\n';
15+ var version_file = hash ;
1416 fs . writeFileSync ( 'VERSION' , version_file ) ;
1517 } else {
1618 // no tag found likely due to shallow clone (--depth=N)
Original file line number Diff line number Diff line change @@ -25,11 +25,13 @@ it('GET should return JSON', function(done) {
2525 function ( res ) {
2626 var body = res . body . replace ( / ^ \s * v a r \s + a b i l i t i e s \s * = \s * ( .+ ?) ; ? $ / , '$1' ) ;
2727 var abilities = JSON . parse ( body ) ;
28- // travis does a shallow clone so the git version and hash will
29- // not be known, which is harmless
28+ // travis does a shallow clone so the git version and hash will not be known, which is harmless
3029 if ( ! process . env . TRAVIS && ! process . env . APPVEYOR ) {
31- assert . ok ( / v \d + .\d + .\d + - \d + - [ a - z 0 - 9 ] + / . test ( abilities . version [ 0 ] ) , abilities . version [ 0 ] ) ;
32- assert . ok ( / \d + .\d + .\d + .\d + / . test ( abilities . version [ 1 ] ) , abilities . version [ 1 ] ) ;
30+ // Checking to see if the unique version from the VERSION file is there. It is used
31+ // to put the unique version (in parens) into the header of the project settings page.
32+ assert . ok ( / v \d + .\d + .\d + .* / . test ( abilities . version [ 0 ] ) , abilities . version [ 0 ] ) ;
33+ // Removed the second version from gitutils.js since it is never used.
34+ //assert.ok(/\d+.\d+.\d+.\d+/.test(abilities.version[1]),abilities.version[1]);
3335 }
3436 assert . ok ( abilities . fonts . indexOf ( 'Arial Regular' ) >= 0 ||
3537 abilities . fonts . indexOf ( 'DejaVu Sans Book' ) >= 0 ) ;
You can’t perform that action at this time.
0 commit comments