UNPKG

gitstrap-cli

Version:

A cli tool that allows you to easily sync with your upstream git repository

35 lines (27 loc) 638 B
#!/usr/bin/env node 'use_strict'; var fs = require('fs'); var cmd = process.argv[2]; var sync = function() { var branch = process.argv[3]; require('./modules/syncRepo.js')(branch); } var init = function() { var originalRepo = process.argv[3]; var forkRepo = process.argv[4]; var folderName = process.argv[5]; require('./modules/initRepo.js')(originalRepo, forkRepo, folderName); } var displayHelp = function() { console.log("Usage: \n gitstrap init <originalRepo> <myRepo> \n gitstrap sync <upstream branch>"); } switch (cmd) { case 'sync': sync(); break; case 'init': init(); break; default: displayHelp(); }