Skip to content

Commit

Permalink
[add] Colonel Kurtz binary
Browse files Browse the repository at this point in the history
  • Loading branch information
nhunzaker committed Mar 27, 2015
1 parent 7cbe697 commit 6d86d40
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
12 changes: 11 additions & 1 deletion bin/colonel_kurtz.js
@@ -1,4 +1,14 @@
#!/usr/bin/env node
'use strict';

var raw = process.argv[2];
var migrate = require('../lib/migrate')
console.log('hey')
var json;

if (!raw.trim()) {
process.exit(1);
}

json = JSON.parse(raw)

console.log(JSON.stringify(migrate(json)))
1 change: 1 addition & 0 deletions lib/migrate/index.js
Expand Up @@ -6,6 +6,7 @@
*/

var forward = require('./forward')
var version = require('../../package').version

var migrations = [
require('./migrations/2.0.0')
Expand Down
2 changes: 1 addition & 1 deletion lib/migrate/isNewer.js
Expand Up @@ -6,7 +6,7 @@
var semverify = function(string) {
string = string || '0.0.0'

let base = string.split('.').map(function(num) {
var base = string.split('.').map(function(num) {
return parseInt(num, 10)
})

Expand Down
3 changes: 2 additions & 1 deletion lib/migrate/migrations/2.0.0.js
Expand Up @@ -2,9 +2,10 @@ module.exports = {
version: '2.0.0',

// 2.0.0 adds a sections block type that wraps around all other
// types
// types. It also adds a system object
up: function (state) {
return {
system: { version: '2.0.0' },
blocks: Array.isArray(state) ? [{
blocks : state,
content : {},
Expand Down

0 comments on commit 6d86d40

Please sign in to comment.