Skip to content

Instantly share code, notes, and snippets.

@cab
Created June 16, 2015 00:19
Show Gist options
  • Save cab/187ae378c358643047dc to your computer and use it in GitHub Desktop.
Save cab/187ae378c358643047dc to your computer and use it in GitHub Desktop.
#! /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