setVersion 585 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env php
  2. <?php
  3. /*
  4. * This file is part of php-restcord.
  5. *
  6. * (c) Aaron Scherer <aequasi@gmail.com>
  7. *
  8. * This source file is subject to the license that is bundled
  9. * with this source code in the file LICENSE
  10. */
  11. require __DIR__.'/../vendor/autoload.php';
  12. // https://gist.github.com/stevegrunwell/3363975
  13. function get_current_git_commit($branch = 'master')
  14. {
  15. if ($hash = file_get_contents(sprintf('.git/refs/heads/%s', $branch))) {
  16. return $hash;
  17. } else {
  18. return false;
  19. }
  20. }
  21. file_put_contents(__DIR__ .'/../VERSION', get_current_git_commit());