Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #!/usr/bin/env php
  2. <?php
  3. $branches_to_skip = array( 'master', 'develop' );
  4. $the_branch = shell_exec( 'git symbolic-ref --short HEAD' );
  5. $the_file = 'somefile';
  6.  
  7. if ( file_exists( $the_file ) && ! in_array( trim( $the_branch ), $branches_to_skip ) ) {
  8. echo "The file was found and you are on the {$the_branch} branch\r\n";
  9. unlink( $the_file );
  10. echo "{$the_file} was removed\r\n";
  11. } else {
  12. echo "The {$the_file} doesn't seem to exist or your on {$the_branch} so it's all good nothing was changed\r\n";
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement