Add custom git commands

This commit is contained in:
Oliver Davies 2019-10-22 10:50:54 +01:00
parent ceb01ff80c
commit 295dd570c7
2 changed files with 117 additions and 0 deletions

11
bin/git-publish Executable file
View file

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