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
#!/bin/bash | |
# directory for storing branch specific gitignore files | |
mkdir .gitignores | |
# empty file for production branch | |
touch .gitignores/production | |
# ignore build on any other branch | |
echo "build" >> .gitignores/default |
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 execSync = require('child_process').execSync; | |
var exec = function (command) { | |
return execSync(command, { pwd: '../../', encoding: 'utf8' }); | |
}; | |
// get current branch name as single value | |
var currentBranch = exec('git rev-parse --abbrev-ref HEAD').trim(); |