12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #!/bin/bash
- # fail if any commands fails
- set -e
- # debug log
- #set -x
- # Set superuser privileges command if not set
- if [[ -z $su ]]; then
- export su="sudo"
- fi
- $su apt-get install -y build-essential cmake
- application=wadtools
- repository="https://github.com/makise-homura/wadtools.git"
- export compile=
- mkdir -p ~/src
- cd ~/src || return
- if [ ! -d $application ]; then
- git clone $repository
- cd $application || return
- export compile=true
- else
- cd $application || return
- #git pull
- pwd
- git fetch
- LOCAL=$(git rev-parse HEAD)
- REMOTE=$(git rev-parse @{u})
- if [ ! $LOCAL = $REMOTE ]; then
- pwd
- echo "Need to pull"
- git pull
- export compile=true
- fi
- fi
- if [ "$compile" = "true" ]; then
- cd ~/src/$application || return
- mkdir -p build
- cd build || return
- cc ../wadbuild.c -o wadbuild
- cc ../wadxtract.c -o wadxtract
- cc ../wadfindthing.c -o wadfindthing
- #cc ../wadpack.c -o wadpack # compiling error
- #doas cp wadbuild wadxtract wadpack wadfindthing /usr/local/bin
- fi
|