dotfiles/bin/git-publish

16 lines
338 B
PHP
Executable file

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