merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

bootstrap (1895B)


      1 #!/bin/sh
      2 
      3 set -eu
      4 
      5 if ! git --version >/dev/null; then
      6   echo "git not installed"
      7   exit 1
      8 fi
      9 
     10 if ! python3 --version >/dev/null; then
     11   echo "python3 not installed"
     12   exit 1
     13 fi
     14 
     15 # Make sure that "git pull" et al. also update
     16 # submodules to avoid accidental rollbacks.
     17 if [ -d .git ]; then
     18   git config --local submodule.recurse true
     19 fi
     20 
     21 echo "$0: Updating submodules"
     22 # Caution: We do NOT want to fetch the latest version with --remote,
     23 # but instead always the one that's recorded in the repository.
     24 if [ -d .git ]; then
     25   echo | git submodule update --init --force
     26 fi
     27 ./contrib/check-prebuilt
     28 
     29 
     30 # This is more portable than `which' but comes with
     31 # the caveat of not(?) properly working on busybox's ash:
     32 existence()
     33 {
     34     command -v "$1" >/dev/null 2>&1
     35 }
     36 
     37 # Freeze SQL files that must no longer be edited.
     38 for n in 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 0034
     39 do
     40     chmod -w src/backenddb/sql-schema/merchant-$n.sql*
     41 done
     42 
     43 if existence uncrustify; then
     44     echo "Installing uncrustify hook and configuration"
     45     # Install uncrustify format symlink (if possible)
     46     ln -s contrib/uncrustify.cfg uncrustify.cfg 2> /dev/null || true
     47     # Install pre-commit hook (if possible)
     48     ln -s ../../contrib/uncrustify_precommit .git/hooks/pre-commit 2> /dev/null || true
     49 else
     50     echo "Uncrustify not detected, hook not installed. Please install uncrustify if you plan on doing development"
     51 fi
     52 
     53 # Generate Makefile.am in contrib/
     54 #cd contrib
     55 #rm -f Makefile.am
     56 #find wallet-core/backoffice/ -type f | sort | awk '{print "  " $1 " \\" }' > Makefile.am.ext
     57 ## Remove extra '\' at the end of the file
     58 #truncate -s -2 Makefile.am.ext
     59 #cat Makefile.am.in Makefile.am.ext >> Makefile.am
     60 ## Prevent accidental editing of the generated Makefile.am
     61 #chmod -w Makefile.am
     62 #cd ..