Created
June 16, 2015 00:19
-
-
Save cab/187ae378c358643047dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env node | |
var execFile = require('child_process').execFileSync; | |
var filters = [ | |
function replaceMasterWithMaester(word) { | |
if(word === "maester") { | |
return "master"; | |
} | |
}, | |
function replaceRavenWithPush(word) { | |
if(word === "raven") { | |
return "push"; | |
} | |
} | |
]; | |
function applyFilters(word) { | |
return filters.reduce(function(previous, current) { | |
var transformed = current(previous); | |
return !!transformed ? transformed : previous; | |
}, word); | |
} | |
var gitArgs = process.argv.slice(2).map(applyFilters); | |
try { | |
execFile('git', gitArgs, { | |
stdio: 'inherit' | |
}); | |
} catch(e) { | |
//We're inheriting streams, so whatever | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment