Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

add kanso version used to build app to ddoc metadata

  • Loading branch information...
caolan committed Jan 25, 2012
1 parent 0edd1b8 commit 7acf1b224553daeccc24b9b055cafce82b7f39a1
@@ -40,12 +40,12 @@ kansorc.load(function (err, settings) {
usage();
}
else if (cmd === '-v' || cmd === '--version') {
utils.readJSON(__dirname + '/../package.json', function (err, pkg) {
utils.getKansoVersion(function (err, ver) {
if (err) {
return logger.error(err);
}
logger.clean_exit = true;
console.log(pkg.version);
console.log(ver);
});
}
else if (cmd in commands) {
@@ -85,7 +85,13 @@ exports.load = function (name, paths, source, options, callback) {
}
doc.kanso.config = rcfg;
doc.kanso.build_time = utils.ISODateString(new Date());
callback(null, utils.stringifyFunctions(doc), rcfg);
utils.getKansoVersion(function (err, ver) {
if (err) {
return callback(err);
}
doc.kanso.kanso_version = ver;
callback(null, utils.stringifyFunctions(doc), rcfg);
});
});
});
});
@@ -669,3 +669,16 @@ exports.catchAuthError = function (fn, url, extra_args, callback) {
}
}));
};

/**
* Reads the version property from Kanso's package.json
*/

exports.getKansoVersion = function (callback) {
exports.readJSON(__dirname + '/../package.json', function (err, pkg) {
if (err) {
return callback(err);
}
return callback(null, pkg.version);
});
};
@@ -10,6 +10,7 @@
},
"minify": false
},
"build_time": "2012-01-08T00:11:12Z"
"build_time": "2012-01-08T00:11:12Z",
"kanso_version": "0.1.4"
}
}
@@ -10,6 +10,7 @@
},
"minify": false
},
"build_time": "2012-01-08T00:11:28Z"
"build_time": "2012-01-08T00:11:28Z",
"kanso_version": "0.1.4"
}
}
@@ -12,6 +12,7 @@
},
"minify": false
},
"build_time": "2012-01-08T00:11:37Z"
"build_time": "2012-01-08T00:11:37Z",
"kanso_version": "0.1.4"
}
}

0 comments on commit 7acf1b2

Please sign in to comment.
You can’t perform that action at this time.