fork 0k-charms
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
452 B

  1. #!/bin/bash
  2. set -eux
  3. ## 0k git remote path
  4. GIT_0K_BASE=${GIT_0K_BASE:-"0k-ro:/var/git"}
  5. ## 0k git remote options
  6. GIT_0K_CLONE_OPTIONS=${GIT_0K_CLONE_OPTIONS:-""}
  7. ##
  8. ## install git sub
  9. ##
  10. if [ -d /opt/apps/git-sub ]; then
  11. cd /opt/apps/git-sub &&
  12. git pull -r
  13. else
  14. mkdir -p /opt/apps &&
  15. cd /opt/apps &&
  16. git clone $GIT_0K_CLONE_OPTIONS "$GIT_0K_BASE"/0k/git-sub
  17. fi
  18. ln -sf /opt/apps/git-sub/bin/git-sub /usr/lib/git-core/git-sub