#!/usr/bin/env php <?php /** * Usage: git publish */ $currentBranch = exec('git rev-parse --abbrev-ref HEAD'); if (in_array($currentBranch, ['develop', 'master', 'staging', 'production'])) { print "Currently on ${currentBranch}. Aborting."; exit(1); } exec("git push -u origin $currentBranch:opd-{$currentBranch}");