Add script to set version number
This commit is contained in:
parent
50b283aa5e
commit
5a140ab914
10
bower.json
10
bower.json
@ -4,7 +4,9 @@
|
||||
"main": "dist/planetaryjs.min.js",
|
||||
"description": "Awesome interactive globes for the web",
|
||||
"homepage": "http://planetaryjs.com",
|
||||
"authors": [ "Brandon Tilley <brandon@brandontilley.com>" ],
|
||||
"authors": [
|
||||
"Brandon Tilley <brandon@brandontilley.com>"
|
||||
],
|
||||
"license": "MIT",
|
||||
"ignore": [
|
||||
".git",
|
||||
@ -21,8 +23,10 @@
|
||||
"topojson": "1.x"
|
||||
},
|
||||
"keywords": [
|
||||
"globe", "globes",
|
||||
"planet", "planets",
|
||||
"globe",
|
||||
"globes",
|
||||
"planet",
|
||||
"planets",
|
||||
"d3",
|
||||
"topojson"
|
||||
]
|
||||
|
||||
41
script/set-version
Executable file
41
script/set-version
Executable file
@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var fs = require('fs');
|
||||
var spawn = require('child_process').spawn;
|
||||
|
||||
var type = process.argv[2];
|
||||
var version = process.argv[3];
|
||||
var name = process.argv[4]
|
||||
|
||||
if ("stable" !== type && "unstable" !== type) {
|
||||
console.log("You must specify 'stable' or 'unstable' version type.");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (!version) {
|
||||
console.log("You must specify a version.");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (version[0] === 'v') {
|
||||
version = version.replace(/^v/, '');
|
||||
}
|
||||
|
||||
var package = require("../package.json");
|
||||
var bower = require("../bower.json");
|
||||
var site = require("../site/public/download/_data.json");
|
||||
|
||||
package.version = version;
|
||||
bower.version = version;
|
||||
|
||||
site[type].latest = site[type].latest || {};
|
||||
site[type].latest.version = "v" + version;
|
||||
if (name) site[type].latest.name = name;
|
||||
|
||||
fs.writeFileSync('package.json', JSON.stringify(package, null, ' ') + "\n");
|
||||
fs.writeFileSync('bower.json', JSON.stringify(bower, null, ' ') + "\n");
|
||||
fs.writeFileSync('site/public/download/_data.json', JSON.stringify(site, null, ' ') + "\n");
|
||||
|
||||
spawn('npm', ['run', 'build']);
|
||||
|
||||
console.log("Tasks:\n\n - Update CHANGELOG.md\n - Regenerate site");
|
||||
Loading…
Reference in New Issue
Block a user