donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

bootstrap (855B)


      1 #!/bin/sh
      2 # This file is in the public domain.
      3 
      4 set -eu
      5 
      6 if ! git --version >/dev/null; then
      7   echo "git not installed"
      8   exit 1
      9 fi
     10 
     11 echo "$0: Updating submodules"
     12 if [ -d .git ]; then
     13   git submodule update --init --force
     14 fi
     15 
     16 # This is more portable than `which' but comes with
     17 # the caveat of not(?) properly working on busybox's ash:
     18 existence()
     19 {
     20     command -v "$1" >/dev/null 2>&1
     21 }
     22 
     23 
     24 if existence uncrustify; then
     25     echo "Installing uncrustify hook and configuration"
     26     # Install uncrustify format symlink (if possible)
     27     ln -s contrib/uncrustify.cfg uncrustify.cfg 2> /dev/null || true
     28     # Install pre-commit hook (if possible)
     29     ln -s ../../contrib/uncrustify_precommit .git/hooks/pre-commit 2> /dev/null || true
     30 else
     31     echo "Uncrustify not detected, hook not installed. Please install uncrustify if you plan on doing development"
     32 fi