├── .gitignore ├── README.md ├── features ├── git.js ├── listSongs.js ├── music.js ├── setAnthem.js ├── setVolume.js └── version.js ├── lib └── git-push-it ├── package.json ├── songs ├── cinderella.config.json ├── doubtless.config.json ├── erasure.config.json ├── familyrain.config.json ├── fatty.config.json ├── garbage.config.json ├── getdown.config.json ├── kravitz.config.json ├── letitwip.config.json ├── limit.config.json ├── mp3s │ ├── cinderella.mp3 │ ├── doubtless.mp3 │ ├── erasure.mp3 │ ├── familyrain.mp3 │ ├── fatty.mp3 │ ├── garbage.mp3 │ ├── getdown.mp3 │ ├── kravitz.mp3 │ ├── letitwip.mp3 │ ├── limit.mp3 │ ├── oneway.mp3 │ ├── pr-push.mp3 │ ├── pushit.mp3 │ ├── pushitup.mp3 │ ├── pushme.mp3 │ ├── pushpull.mp3 │ ├── pushshove.mp3 │ ├── staticx.mp3 │ └── wip.mp3 ├── oneway.config.json ├── pr-push.config.json ├── pushit.config.json ├── pushitup.config.json ├── pushme.config.json ├── pushpull.config.json ├── pushshove.config.json ├── staticx.config.json └── wip.config.json └── utils ├── argsMatch.js ├── log.js ├── promise.js ├── random.js └── reFind.js /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | *.log 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Git Push-It 2 | 3 | This is a simple git plugin that plays appropriate music while pushing your code. 4 | 5 | This plugin requires `git > 1.8.2` and `node.js > 4.0`. 6 | 7 | This plugin currently only supports mac OSX. 8 | 9 | ## HTTP/HTTPS Remotes 10 | 11 | Using this plugin with a remote via http/https, requires you to login with username and password and 12 | use git's credential helper. 13 | 14 | ```bash 15 | $ git config --global credential.helper cache 16 | ``` 17 | 18 | For more on credential caching with git, view the 19 | [documentation](https://git-scm.com/docs/gitcredentials). 20 | 21 | ## Install or Update 22 | 23 | To install, simply copy and paste the following into your terminal. 24 | 25 | ```bash 26 | $ npm install git-push-it -g 27 | ``` 28 | 29 | ## Usage 30 | 31 | ### Include arguments and flags 32 | 33 | It passes arguments and flags to git push. If no remote and branch are specified, git-push-it 34 | defaults to remote origin and branch master. 35 | 36 | ```bash 37 | $ git push-it #git push origin master 38 | $ git push-it some-remote some-branch --some-flag 39 | ``` 40 | 41 | ### Declare which song to play 42 | 43 | You can set which song to play with the `--anthem` flag. 44 | 45 | ```bash 46 | $ git push-it --anthem=limit 47 | ``` 48 | 49 | ### You can set the volume of the song 50 | 51 | You can set the volume to play with the `--volume` flag. The values are between 0 and 1. The default volume is 1, which is using the maximum media volume. 52 | It accepts decimal values like 0.5 for 50% of the media volume. 53 | 54 | ```bash 55 | $ git push-it --volume=0.5 56 | ``` 57 | 58 | ### List available songs 59 | 60 | ```bash 61 | $ git push-it --list 62 | ``` 63 | 64 | ### Check version 65 | 66 | ```bash 67 | $ git push-it --version 68 | ``` 69 | -------------------------------------------------------------------------------- /features/git.js: -------------------------------------------------------------------------------- 1 | var reFind = require('../utils/reFind'); 2 | var promise = require('../utils/promise'); 3 | 4 | function login(config) { 5 | return promise.exec('git remote -v').then(function (remotes) { 6 | var commands = parseCommands(config.args, remotes.split('\n')); 7 | return commands.reduce(function (chain, command) { 8 | return chain.then(function () { 9 | return promise.exec(command); 10 | }); 11 | }, Promise.resolve()); 12 | }).then(promise.wrap(config)); 13 | } 14 | 15 | function push(args, callback) { 16 | if (args.every(arg => arg.match(/^(^-)/))) { 17 | args = args.concat(['origin', 'master']) 18 | } 19 | var command = ['git', 'push'].concat(args).join(' '); 20 | return promise.exec(command, callback); 21 | } 22 | 23 | function loginCommands(url) { 24 | return [ 25 | 'echo "\\n\\n" | git credential reject', 26 | 'echo "url=' + url + '\\n\\n" | git credential fill | git credential approve' 27 | ]; 28 | } 29 | 30 | function parseCommands(args, remotes) { 31 | var remote = reFind(args, /^[^-]/) || 'origin'; 32 | var remoteVerbose = reFind(remotes, new RegExp('^' + remote + '.*(push)')); 33 | var remoteUrl = (remoteVerbose) ? remoteVerbose.split(/\s/)[1] : ''; 34 | if (remoteUrl.slice(0, 4) === 'http') { 35 | return loginCommands(remoteUrl, args); 36 | } 37 | return []; 38 | } 39 | 40 | function wipPush() { 41 | var args = process.argv.slice(2); 42 | return promise.exec('git branch').then(function (branches) { 43 | return reFind(branches.split('\n'), /\*.*wip/i); 44 | }); 45 | } 46 | 47 | module.exports = { 48 | login: login, 49 | push: push, 50 | wipPush: wipPush 51 | }; 52 | -------------------------------------------------------------------------------- /features/listSongs.js: -------------------------------------------------------------------------------- 1 | var joinPath = require('path.join'); 2 | var git = require('./git'); 3 | var promise = require('../utils/promise'); 4 | 5 | function listSongs(description) { 6 | var dir = joinPath(__dirname, '/../songs'); 7 | return Promise.all([ 8 | promise.readDirectory(dir), 9 | git.wipPush() 10 | ]).then(function (results) { 11 | return Promise.all(getSongs(results[0], isWip(results[1]), description)); 12 | }); 13 | } 14 | 15 | function getSongs(files, onWip, description) { 16 | return files.filter(function (file) { 17 | return file.match(/.*\.config\.json$/i); 18 | }).filter(function (file) { 19 | if (onWip) return file.match(/wip/i); 20 | return !file.match(/wip/i); 21 | }).map(function (file) { 22 | var name = file.replace(/\.config\.json/, ''); 23 | if (description) { 24 | return getDetails(name, joinPath(__dirname, '/../songs/' + file)); 25 | } 26 | return Promise.resolve(name); 27 | }); 28 | } 29 | 30 | function getDetails(name, file) { 31 | return promise.readFile(file) 32 | .then(JSON.parse) 33 | .then(function (result) { 34 | return result.meta; 35 | }).catch(function () { 36 | return {}; 37 | }).then(function (meta) { 38 | return name + ': ' + meta.title + ' by ' + meta.artist; 39 | }); 40 | } 41 | 42 | function isWip(onWip) { 43 | inArgs = process.argv.slice(2).find(function (arg) { 44 | return arg.match(/wip/i) && !arg.match(/anthem/); 45 | }); 46 | return onWip || inArgs; 47 | } 48 | 49 | module.exports = listSongs; 50 | -------------------------------------------------------------------------------- /features/music.js: -------------------------------------------------------------------------------- 1 | var joinPath = require('path.join'); 2 | var log = require('../utils/log'); 3 | var promise = require('../utils/promise'); 4 | 5 | function play(song, volume, callback) { 6 | var file = joinPath(__dirname, '/../songs/mp3s/' + song + '.mp3'); 7 | return promise.exec('afplay --volume ' + volume + ' ' + file, callback); 8 | } 9 | 10 | function lyrics(song) { 11 | return getConfig(song).then(function (lyrics) { 12 | return Promise.all(lyrics.map(timed)); 13 | }); 14 | } 15 | 16 | function timed(lyric) { 17 | return new Promise(function (resolve, reject) { 18 | setTimeout(function () { 19 | resolve(log(lyric.lyric)); 20 | }, lyric.timeout); 21 | }); 22 | } 23 | 24 | function getConfig(song) { 25 | var file = joinPath(__dirname, '/../songs/' + song + '.config.json'); 26 | return promise.readFile(file).then(JSON.parse).then(function (data) { 27 | return data.lyrics; 28 | }); 29 | } 30 | 31 | module.exports = { 32 | play: play, 33 | lyrics: lyrics 34 | }; 35 | -------------------------------------------------------------------------------- /features/setAnthem.js: -------------------------------------------------------------------------------- 1 | var git = require('./git'); 2 | var listSongs = require('./listSongs'); 3 | var random = require('../utils/random'); 4 | 5 | module.exports = function () { 6 | return listSongs().then(function (songs) { 7 | var args = process.argv.slice(2); 8 | var arg = getAnthem(args); 9 | return { 10 | anthem: verifyAnthem(arg, songs) || random(songs), 11 | args: filterArgs(args) 12 | }; 13 | }); 14 | }; 15 | 16 | function getAnthem(args) { 17 | return args.find(function (arg) { 18 | return arg.match(/^--anthem=/); 19 | }); 20 | } 21 | 22 | function verifyAnthem(arg, songs) { 23 | if (!arg) return; 24 | var anthem = arg.split('=')[1]; 25 | return songs.find(function (song) { 26 | return song === anthem; 27 | }); 28 | } 29 | 30 | function filterArgs(args) { 31 | return args.filter(function (arg) { 32 | return !arg.match(/^--anthem/); 33 | }); 34 | } 35 | -------------------------------------------------------------------------------- /features/setVolume.js: -------------------------------------------------------------------------------- 1 | module.exports = function (config) { 2 | // volume is a number between 0 and 1 3 | var volumeArg = getVolume(config.args); 4 | var volume = verifyVolume(volumeArg) || 1; 5 | 6 | return { 7 | ...config, 8 | args: filterArgs(config.args), 9 | volume 10 | }; 11 | }; 12 | 13 | function getVolume(args) { 14 | return args.find(function (arg) { 15 | return arg.match(/^--volume=/); 16 | }); 17 | } 18 | 19 | function verifyVolume(arg) { 20 | if (!arg) return; 21 | return arg.split('=')[1]; 22 | } 23 | 24 | function filterArgs(args) { 25 | return args.filter(function (arg) { 26 | return !arg.match(/^--volume=/); 27 | }); 28 | } 29 | -------------------------------------------------------------------------------- /features/version.js: -------------------------------------------------------------------------------- 1 | var joinPath = require('path.join'); 2 | var log = require('../utils/log'); 3 | var promise = require('../utils/promise'); 4 | 5 | function checkVersion() { 6 | return Promise.all([ 7 | getCurrentVersion(), getLocalVersion() 8 | ]).then(versions => { 9 | return { current: versions[0], local: versions[1] }; 10 | }); 11 | } 12 | 13 | function getCurrentVersion() { 14 | return new Promise(function (resolve, reject) { 15 | var command = 'npm view git-push-it --json -loglevel silent'; 16 | promise.exec(command) 17 | .then(JSON.parse) 18 | .then(function (data) { 19 | return data['dist-tags'].latest; 20 | }).then(resolve, reject); 21 | setTimeout(resolve, 6500); 22 | }); 23 | } 24 | 25 | function getLocalVersion() { 26 | var file = joinPath(__dirname + '/../package.json'); 27 | return promise.readFile(file) 28 | .then(JSON.parse) 29 | .then(function (package) { 30 | return package.version; 31 | }); 32 | } 33 | 34 | function logVersion(version) { 35 | log('git-push-it version ' + version + '\n'); 36 | } 37 | 38 | function outdatedMessage(versions) { 39 | if (versions.current > versions.local) { 40 | return [ 41 | 'There is a new version of git-push-it available.\n', 42 | 'Run "npm install git-push-it -g" to get the newest version.\n' 43 | ]; 44 | } 45 | return ''; 46 | } 47 | 48 | module.exports = { 49 | checkVersion: checkVersion, 50 | getCurrentVersion: getCurrentVersion, 51 | getLocalVersion: getLocalVersion, 52 | logVersion: logVersion, 53 | outdatedMessage: outdatedMessage 54 | }; 55 | -------------------------------------------------------------------------------- /lib/git-push-it: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var argsMatch = require('../utils/argsMatch'); 3 | var git = require('../features/git'); 4 | var listSongs = require('../features/listSongs'); 5 | var log = require('../utils/log'); 6 | var music = require('../features/music'); 7 | var setAnthem = require('../features/setAnthem'); 8 | var setVolume = require('../features/setVolume'); 9 | var version = require('../features/version'); 10 | 11 | var processes = []; 12 | 13 | function main() { 14 | shouldShowVersion() 15 | .then(shouldListSongs) 16 | .then(setAnthem) 17 | .then(setVolume) 18 | .then(git.login) 19 | .then(gitPushIt) 20 | .then(log, console.error) 21 | .then(killProcesses) 22 | .then(process.exit); 23 | } 24 | 25 | function gitPushIt(config) { 26 | return Promise.all([ 27 | music.play(config.anthem, config.volume, addProcessChild), 28 | music.lyrics(config.anthem), 29 | git.push(config.args, addProcessChild), 30 | version.checkVersion().then(version.outdatedMessage) 31 | ]).then(function (data) { 32 | console.log('\n'); 33 | return data; 34 | }); 35 | } 36 | 37 | function shouldListSongs() { 38 | if (argsMatch('--list')) { 39 | return listSongs(true) 40 | .then(formatSongList) 41 | .then(log) 42 | .then(process.exit); 43 | } 44 | return Promise.resolve(); 45 | } 46 | 47 | function shouldShowVersion() { 48 | if (argsMatch('--version')) { 49 | return version.getLocalVersion() 50 | .then(version.logVersion) 51 | .then(process.exit); 52 | } 53 | return Promise.resolve(); 54 | } 55 | 56 | function killProcesses() { 57 | processes.forEach(function (child) { 58 | child.kill('SIGKILL'); 59 | }); 60 | } 61 | 62 | function addProcessChild(child) { 63 | processes.push(child); 64 | } 65 | 66 | function formatSongList(songs) { 67 | return ['Available songs:\n'].concat(songs.map(function (song) { 68 | return ' ' + song + '\n'; 69 | })); 70 | } 71 | 72 | main(); 73 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "git-push-it", 3 | "version": "2.8.0", 4 | "description": "A git plugin for playing appropriate music while pushing code", 5 | "main": "lib/git-push-it", 6 | "dependencies": { 7 | "path.join": "^1.0.0" 8 | }, 9 | "devDependencies": {}, 10 | "bin": { 11 | "git-push-it": "./lib/git-push-it" 12 | }, 13 | "preferGlobal": true, 14 | "scripts": { 15 | "test": "echo \"Error: no test specified\" && exit 1" 16 | }, 17 | "repository": { 18 | "type": "git", 19 | "url": "git+https://github.com/skuttleman/git-push-it.git" 20 | }, 21 | "author": "skuttleman@gmail.com", 22 | "license": "ISC", 23 | "bugs": { 24 | "url": "https://github.com/skuttleman/git-push-it/issues" 25 | }, 26 | "homepage": "https://github.com/skuttleman/git-push-it#readme" 27 | } 28 | -------------------------------------------------------------------------------- /songs/cinderella.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "lyrics": [ 3 | { "lyric": "Push!", "timeout": 5 }, 4 | { "lyric": " Push!", "timeout": 500 }, 5 | { "lyric": "\nIf you TAKE a little...\n", "timeout": 1650 }, 6 | { "lyric": "Push!", "timeout": 3655 }, 7 | { "lyric": " Push!", "timeout": 4150 }, 8 | { "lyric": "\nThen you'll GET a little...\n", "timeout": 5200 }, 9 | { "lyric": "Push!", "timeout": 7305 }, 10 | { "lyric": " Push!", "timeout": 7800 }, 11 | { "lyric": "\n\\m/", "timeout": 13000 }, 12 | { "lyric": " \\m/", "timeout": 13500 } 13 | ], 14 | "meta": { 15 | "artist": "Cinderella", 16 | "title": "Push, Push" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /songs/doubtless.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "lyrics": [ 3 | { "lyric": "You push and shove.", "timeout": 200 }, 4 | { "lyric": "\nI take the bait.", "timeout": 2200 }, 5 | { "lyric": "\nIt's a risky business gonna play it anyway.", "timeout": 3910 }, 6 | { "lyric": "\nYou're working hard!", "timeout": 6325 }, 7 | { "lyric": "\nBoy you got me good", "timeout": 11650 }, 8 | { "lyric": " how you push and shove.", "timeout": 14000 } 9 | ], 10 | "meta": { 11 | "artist": "No Doubt", 12 | "title": "Push and Shove" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /songs/erasure.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "lyrics": [ 3 | { "lyric": "Push me.", "timeout": 75 }, 4 | { "lyric": " Shove me.", "timeout": 1025 }, 5 | { "lyric": "\nI don't call that \"love me\".", "timeout": 2525 }, 6 | { "lyric": "\nI call that", "timeout": 3975 }, 7 | { "lyric": " \"over\".", "timeout": 4690 } 8 | ], 9 | "meta": { 10 | "artist": "Erasure", 11 | "title": "Push Me Shove Me" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /songs/familyrain.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "lyrics": [ 3 | { "lyric": "Push", "timeout": 400 }, 4 | { "lyric": "ing ", "timeout": 675 }, 5 | { "lyric": "it ", "timeout": 925 }, 6 | { "lyric": "hard", "timeout": 1250 }, 7 | { "lyric": "\nTo see ", "timeout": 1650 }, 8 | { "lyric": "if you can", "timeout": 2400 }, 9 | { "lyric": "\nBe ", "timeout": 3450 }, 10 | { "lyric": "there ", "timeout": 3675 }, 11 | { "lyric": "by ", "timeout": 3950 }, 12 | { "lyric": "your", "timeout": 4225 }, 13 | { "lyric": "selves", "timeout": 4500 } 14 | ], 15 | "meta": { 16 | "artist": "Family Rain", 17 | "title": "Pushing It" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /songs/fatty.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "lyrics": [ 3 | { "lyric": "Push the tempo\n", "timeout": 1050 }, 4 | { "lyric": "Push the tempo\n", "timeout": 2050 }, 5 | { "lyric": "Push the tempo\n", "timeout": 3100 }, 6 | { "lyric": "Push the tempo\n", "timeout": 4100 }, 7 | { "lyric": "Push the tempo\n", "timeout": 5150 }, 8 | { "lyric": "Push the tempo", "timeout": 6150 } 9 | ], 10 | "meta": { 11 | "artist": "Fat Boy Slim", 12 | "title": "Push the Tempo" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /songs/garbage.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "lyrics": [ 3 | { "lyric": "(push it)\n", "timeout": 25 }, 4 | { "lyric": "(push it)", "timeout": 3800 } 5 | ], 6 | "meta": { 7 | "artist": "Garbage", 8 | "title": "Push It" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /songs/getdown.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "lyrics": [ 3 | { "lyric": "Push it.\n", "timeout": 1050 }, 4 | { "lyric": "Push it.\n", "timeout": 1550 }, 5 | { "lyric": "I'm perfect.\n", "timeout": 3000 }, 6 | { "lyric": "Push it.\n", "timeout": 4550 }, 7 | { "lyric": "Push it.\n", "timeout": 5025 }, 8 | { "lyric": "Push it.\n", "timeout": 5575 }, 9 | { "lyric": "Push it.\n", "timeout": 6050 }, 10 | { "lyric": "Get ", "timeout": 6750 }, 11 | { "lyric": "down.", "timeout": 7000 } 12 | ], 13 | "meta": { 14 | "artist": "Unknown", 15 | "title": "Perfect (Exceeder)" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /songs/kravitz.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "lyrics": [ 3 | { "lyric": "I'm gonna", "timeout": 10 }, 4 | { "lyric": " Push", "timeout": 870 }, 5 | { "lyric": " my life today.", "timeout": 1725 }, 6 | { "lyric": "\nPush so I can", "timeout": 3725 }, 7 | { "lyric": " see the way.", "timeout": 5500 }, 8 | { "lyric": "\nGonna Push until I", "timeout": 6750 }, 9 | { "lyric": " find", "timeout": 8950 }, 10 | { "lyric": " my", "timeout": 9325 }, 11 | { "lyric": " way", "timeout": 9775 }, 12 | { "lyric": " home.", "timeout": 10175 } 13 | ], 14 | "meta": { 15 | "artist": "Lenny Kravitz", 16 | "title": "Push" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /songs/letitwip.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "lyrics": [ 3 | { "lyric": "Love to you see you WIP it.", "timeout": 500 }, 4 | { "lyric": "\nSugar treat you right.", "timeout": 2300 }, 5 | { "lyric": "\nLet it WIP.", "timeout": 3700 }, 6 | { "lyric": "\nLet it WIP.", "timeout": 7325 }, 7 | { "lyric": " (I'm gonna whip.", "timeout": 8275 }, 8 | { "lyric": " I'm gonna whip)", "timeout": 9875 } 9 | ], 10 | "meta": { 11 | "artist": "SR-71", 12 | "title": "Let It Whip" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /songs/limit.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "lyrics": [ 3 | { "lyric": "Push it to the limit.\n", "timeout": 25 }, 4 | { "lyric": "Walk along the razor's edge.\n", "timeout": 4050 }, 5 | { "lyric": "But don't look down.\n", "timeout": 6900 }, 6 | { "lyric": "Just keep your head.\n", "timeout": 8300 }, 7 | { "lyric": "Or you'll be finished.\n", "timeout": 9600 }, 8 | { "lyric": "Push it to the limit!!!!\n", "timeout": 15666 }, 9 | { "lyric": "...the limit.\n", "timeout": 17150 }, 10 | { "lyric": "...the limit.\n", "timeout": 17933 }, 11 | { "lyric": "...the limit.\n", "timeout": 18666 }, 12 | { "lyric": "...the limit!", "timeout": 19400 } 13 | ], 14 | "meta": { 15 | "artist": "Paul Engemann", 16 | "title": "Push It to the Limit" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /songs/mp3s/cinderella.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skuttleman/git-push-it/5b1ba5270deca91565cbec5928f173a1c07305f6/songs/mp3s/cinderella.mp3 -------------------------------------------------------------------------------- /songs/mp3s/doubtless.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skuttleman/git-push-it/5b1ba5270deca91565cbec5928f173a1c07305f6/songs/mp3s/doubtless.mp3 -------------------------------------------------------------------------------- /songs/mp3s/erasure.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skuttleman/git-push-it/5b1ba5270deca91565cbec5928f173a1c07305f6/songs/mp3s/erasure.mp3 -------------------------------------------------------------------------------- /songs/mp3s/familyrain.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skuttleman/git-push-it/5b1ba5270deca91565cbec5928f173a1c07305f6/songs/mp3s/familyrain.mp3 -------------------------------------------------------------------------------- /songs/mp3s/fatty.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skuttleman/git-push-it/5b1ba5270deca91565cbec5928f173a1c07305f6/songs/mp3s/fatty.mp3 -------------------------------------------------------------------------------- /songs/mp3s/garbage.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skuttleman/git-push-it/5b1ba5270deca91565cbec5928f173a1c07305f6/songs/mp3s/garbage.mp3 -------------------------------------------------------------------------------- /songs/mp3s/getdown.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skuttleman/git-push-it/5b1ba5270deca91565cbec5928f173a1c07305f6/songs/mp3s/getdown.mp3 -------------------------------------------------------------------------------- /songs/mp3s/kravitz.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skuttleman/git-push-it/5b1ba5270deca91565cbec5928f173a1c07305f6/songs/mp3s/kravitz.mp3 -------------------------------------------------------------------------------- /songs/mp3s/letitwip.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skuttleman/git-push-it/5b1ba5270deca91565cbec5928f173a1c07305f6/songs/mp3s/letitwip.mp3 -------------------------------------------------------------------------------- /songs/mp3s/limit.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skuttleman/git-push-it/5b1ba5270deca91565cbec5928f173a1c07305f6/songs/mp3s/limit.mp3 -------------------------------------------------------------------------------- /songs/mp3s/oneway.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skuttleman/git-push-it/5b1ba5270deca91565cbec5928f173a1c07305f6/songs/mp3s/oneway.mp3 -------------------------------------------------------------------------------- /songs/mp3s/pr-push.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skuttleman/git-push-it/5b1ba5270deca91565cbec5928f173a1c07305f6/songs/mp3s/pr-push.mp3 -------------------------------------------------------------------------------- /songs/mp3s/pushit.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skuttleman/git-push-it/5b1ba5270deca91565cbec5928f173a1c07305f6/songs/mp3s/pushit.mp3 -------------------------------------------------------------------------------- /songs/mp3s/pushitup.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skuttleman/git-push-it/5b1ba5270deca91565cbec5928f173a1c07305f6/songs/mp3s/pushitup.mp3 -------------------------------------------------------------------------------- /songs/mp3s/pushme.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skuttleman/git-push-it/5b1ba5270deca91565cbec5928f173a1c07305f6/songs/mp3s/pushme.mp3 -------------------------------------------------------------------------------- /songs/mp3s/pushpull.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skuttleman/git-push-it/5b1ba5270deca91565cbec5928f173a1c07305f6/songs/mp3s/pushpull.mp3 -------------------------------------------------------------------------------- /songs/mp3s/pushshove.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skuttleman/git-push-it/5b1ba5270deca91565cbec5928f173a1c07305f6/songs/mp3s/pushshove.mp3 -------------------------------------------------------------------------------- /songs/mp3s/staticx.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skuttleman/git-push-it/5b1ba5270deca91565cbec5928f173a1c07305f6/songs/mp3s/staticx.mp3 -------------------------------------------------------------------------------- /songs/mp3s/wip.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skuttleman/git-push-it/5b1ba5270deca91565cbec5928f173a1c07305f6/songs/mp3s/wip.mp3 -------------------------------------------------------------------------------- /songs/oneway.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "lyrics": [ 3 | { "lyric": "Push.", "timeout": 10 }, 4 | { "lyric": " Push.", "timeout": 900 }, 5 | { "lyric": " Push.", "timeout": 1750 }, 6 | { "lyric": "\nPush it in the groove.", "timeout": 3125 }, 7 | { "lyric": " \uD83C\uDFba", "timeout": 5450 }, 8 | { "lyric": " \uD83C\uDFba", "timeout": 5700 }, 9 | { "lyric": " \uD83C\uDFba", "timeout": 5975 }, 10 | { "lyric": " \uD83C\uDFba ", "timeout": 6100 }, 11 | { "lyric": "\nPush.", "timeout": 8110 }, 12 | { "lyric": " Push.", "timeout": 9000 }, 13 | { "lyric": " Push.", "timeout": 9850 }, 14 | { "lyric": "\nMake my body move.", "timeout": 11225 }, 15 | { "lyric": " \uD83C\uDFba", "timeout": 13550 }, 16 | { "lyric": " \uD83C\uDFba", "timeout": 13800 }, 17 | { "lyric": " \uD83C\uDFba", "timeout": 14075 }, 18 | { "lyric": " \uD83C\uDFba ", "timeout": 14200 } 19 | ], 20 | "meta": { 21 | "artist": "One Way", 22 | "title": "Push" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /songs/pr-push.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "lyrics": [ 3 | { "lyric": "Push! ", "timeout": 50 }, 4 | { "lyric": "\u266c ", "timeout": 2200 }, 5 | { "lyric": "\u266c ", "timeout": 2600 }, 6 | { "lyric": "\u266c ", "timeout": 2975 }, 7 | { "lyric": "\nPush! ", "timeout": 4350 }, 8 | { "lyric": "\u266c ", "timeout": 6500 }, 9 | { "lyric": "\u266c ", "timeout": 6950 }, 10 | { "lyric": "\u266c ", "timeout": 7300 }, 11 | { "lyric": "\nPush!", "timeout": 8800 } 12 | ], 13 | "meta": { 14 | "artist": "Prince", 15 | "title": "Push" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /songs/pushit.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "lyrics": [ 3 | { "lyric": "Push it.\n", "timeout": 785 }, 4 | { "lyric": "Push it good.\n", "timeout": 2725 }, 5 | { "lyric": "Push it.\n", "timeout": 4725 }, 6 | { "lyric": "Push\n", "timeout": 6000 }, 7 | { "lyric": "it\n", "timeout": 6250 }, 8 | { "lyric": "REAL\n", "timeout": 6525 }, 9 | { "lyric": "GOOD!", "timeout": 7000 } 10 | ] 11 | , 12 | "meta": { 13 | "artist": "Salt-N-Pepa", 14 | "title": "Push It" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /songs/pushitup.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "lyrics": [ 3 | { "lyric": "Everybody here.\n", "timeout": 785 }, 4 | { "lyric": "This is the jam of the year.\n", "timeout": 2750 }, 5 | { "lyric": "Push it up.\n", "timeout": 6000 }, 6 | { "lyric": "Push it up.", "timeout": 8710 } 7 | ], 8 | "meta": { 9 | "artist": "Prince", 10 | "title": "Push It Up" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /songs/pushme.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "lyrics": [ 3 | { "lyric": "Everything I do\n", "timeout": 50 }, 4 | { "lyric": "It's all because you\n", "timeout": 2000 }, 5 | { "lyric": "Push ", "timeout": 4400 }, 6 | { "lyric": "me.", "timeout": 5600 } 7 | ], 8 | "meta": { 9 | "artist": "Madonna", 10 | "title": "Push" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /songs/pushpull.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "lyrics": [ 3 | { "lyric": "You push and", "timeout": 175 }, 4 | { "lyric": " you pull and", "timeout": 1000 }, 5 | { "lyric": " struggle with the knot.\uD83D\uDD6F ", "timeout": 1850 }, 6 | { "lyric": "\nIt's tying you up while your fading.\uD83D\uDD6F ", "timeout": 4500 }, 7 | { "lyric": "\nYou push and", "timeout": 7250 }, 8 | { "lyric": " you pull and", "timeout": 8125 }, 9 | { "lyric": " struggle with the knot.\uD83D\uDD6F ", "timeout": 8975 }, 10 | { "lyric": "\nIt's tying you up while your fading", "timeout": 11600 }, 11 | { "lyric": " into your lie.\uD83D\uDD6F ", "timeout": 14175 }, 12 | { "lyric": "\uD83D\uDD6F ", "timeout": 16715 }, 13 | { "lyric": "\uD83D\uDD6F ", "timeout": 18675 }, 14 | { "lyric": "\uD83D\uDD6F ", "timeout": 20400 } 15 | ], 16 | "meta": { 17 | "artist": "Nikka Costa", 18 | "title": "Push and Pull" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /songs/pushshove.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "lyrics": [ 3 | { "lyric": "Pushin' ", "timeout": 25 }, 4 | { "lyric": "and ", "timeout": 700 }, 5 | { "lyric": "shovin' ", "timeout": 1450 }, 6 | { "lyric": "me.", "timeout": 2175 }, 7 | { "lyric": "\nPushin' ", "timeout": 2900 }, 8 | { "lyric": "and ", "timeout": 3650 }, 9 | { "lyric": "shovin' ", "timeout": 4400 }, 10 | { "lyric": "ME!", "timeout": 5050 }, 11 | { "lyric": "\nPUSHIN' ", "timeout": 5800 }, 12 | { "lyric": "AND ", "timeout": 6600 }, 13 | { "lyric": "SHOVIN' ", "timeout": 7350 }, 14 | { "lyric": "ME!", "timeout": 8000 }, 15 | { "lyric": "\nPUSHIN' ", "timeout": 8700 }, 16 | { "lyric": "AND ", "timeout": 9400 }, 17 | { "lyric": "SHOVIN' ", "timeout": 10100 }, 18 | { "lyric": "ME! \\m/", "timeout": 10700 }, 19 | { "lyric": "\n\uD83C\uDFB8 ", "timeout": 11600 }, 20 | { "lyric": "\uD83C\uDFB8 ", "timeout": 12300 }, 21 | { "lyric": "\uD83C\uDFB8 ", "timeout": 13000 }, 22 | { "lyric": "\uD83C\uDFB8 ", "timeout": 13650 }, 23 | { "lyric": "\uD83C\uDFB8 ", "timeout": 14450 }, 24 | { "lyric": "\uD83C\uDFB8 ", "timeout": 15150 }, 25 | { "lyric": "\uD83C\uDFB8 ", "timeout": 15800 }, 26 | { "lyric": "\uD83C\uDFB8 ", "timeout": 16500 }, 27 | { "lyric": "\uD83C\uDFB8 ", "timeout": 17150 }, 28 | { "lyric": "\uD83C\uDFB8 ", "timeout": 17800 }, 29 | { "lyric": "\uD83C\uDFB8 ", "timeout": 18600 }, 30 | { "lyric": "\uD83C\uDFB8 ", "timeout": 19250 }, 31 | { "lyric": "\uD83C\uDFB8 ", "timeout": 20000 }, 32 | { "lyric": "\uD83C\uDFB8 ", "timeout": 20700 }, 33 | { "lyric": "\uD83C\uDFB8 ", "timeout": 21450 }, 34 | { "lyric": "\uD83C\uDFB8 ", "timeout": 22150 } 35 | ], 36 | "meta": { 37 | "artist": "Tool", 38 | "title": "Pushit" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /songs/staticx.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "lyrics": [ 3 | { "lyric": "YEAH!\n", "timeout": 25 }, 4 | { "lyric": "Ya push it!\n", "timeout": 600 }, 5 | { "lyric": "YEAH!\n", "timeout": 1575 }, 6 | { "lyric": "Ya push it!\n", "timeout": 2150 }, 7 | { "lyric": "YEAH!\n", "timeout": 3125 }, 8 | { "lyric": "Ya push it!", "timeout": 3700 } 9 | ], 10 | "meta": { 11 | "artist": "Static-X", 12 | "title": "Push It" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /songs/wip.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "lyrics": [ 3 | { "lyric": "When something's going wrong\n", "timeout": 150 }, 4 | { "lyric": "You must WIP it.\n", "timeout": 1675 }, 5 | { "lyric": "Now WIP it. ", "timeout": 4000 }, 6 | { "lyric": "WIP it good.", "timeout": 5450 } 7 | ], 8 | "meta": { 9 | "artist": "Devo", 10 | "title": "Whip It" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /utils/argsMatch.js: -------------------------------------------------------------------------------- 1 | module.exports = function (pattern) { 2 | return process.argv.find(function (arg) { 3 | return arg.match(pattern); 4 | }); 5 | }; 6 | -------------------------------------------------------------------------------- /utils/log.js: -------------------------------------------------------------------------------- 1 | module.exports = function (messages) { 2 | logMessages([].concat(messages)); 3 | }; 4 | 5 | function logMessages(messages) { 6 | messages.forEach(function (message) { 7 | if (message instanceof Array) { 8 | logMessages(message); 9 | } else if (message && message.trim && message.trim()) { 10 | process.stdout.write(message); 11 | } 12 | }) 13 | } 14 | -------------------------------------------------------------------------------- /utils/promise.js: -------------------------------------------------------------------------------- 1 | var exec = require('child_process').exec; 2 | var fs = require('fs'); 3 | 4 | function promiseExec(command, callback) { 5 | return new Promise(function (resolve, reject) { 6 | var child = exec(command, function (err, stdout, out) { 7 | if (err) return reject(err); 8 | resolve(out || stdout); 9 | }); 10 | callback && callback(child) 11 | }); 12 | }; 13 | 14 | function promiseReadFile(file) { 15 | return new Promise(function (resolve, reject) { 16 | fs.readFile(file, 'utf-8', function (err, data) { 17 | if (err) return reject(err); 18 | resolve(data); 19 | }); 20 | }); 21 | }; 22 | 23 | function promiseReadDirectory(path) { 24 | return new Promise(function (resolve, reject) { 25 | fs.readdir(path, function (err, files) { 26 | if (err) return reject(err); 27 | resolve(files); 28 | }); 29 | }); 30 | }; 31 | 32 | function promiseWrap(value) { 33 | return function () { 34 | return Promise.resolve(value); 35 | }; 36 | } 37 | 38 | module.exports = { 39 | wrap: promiseWrap, 40 | exec: promiseExec, 41 | readFile: promiseReadFile, 42 | readDirectory: promiseReadDirectory 43 | }; 44 | -------------------------------------------------------------------------------- /utils/random.js: -------------------------------------------------------------------------------- 1 | module.exports = function (array) { 2 | var index = Math.floor(Math.random() * array.length); 3 | return array[index] 4 | }; 5 | -------------------------------------------------------------------------------- /utils/reFind.js: -------------------------------------------------------------------------------- 1 | module.exports = function (array, regex) { 2 | return array.find(function (element) { 3 | return element && element.match && element.match(regex); 4 | }); 5 | }; 6 | --------------------------------------------------------------------------------