Skip to content

Commit

Permalink
Makes external/git/clone.sh POSIX shell compatible (letoram#261)
Browse files Browse the repository at this point in the history
FossilOrigin-Name: d2da2c2dd05d2acb0c33c4dcf184bb71fe7a927745e615e649f68ab3b43f47a7
  • Loading branch information
web-flow committed Oct 22, 2022
1 parent 2487e86 commit e02c29e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions external/git/clone.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
#!/bin/bash
#!/bin/sh

# solution plucked from http://stackoverflow.com/questions/59895
SOURCE="${BASH_SOURCE[0]}"
SOURCE="$0"
while [ -h "$SOURCE" ]; do
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
case $SOURCE in
"/"*) true ;;
*) SOURCE="$DIR/$SOURCE" ;;
esac
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

if [ ! -f "$DIR/clone.sh" ] || [ -h "$DIR/clone.sh" ]; then
>&2 echo 'Could not resolve source directory, make sure to execute the source file instead of sourcing it'
exit 1
fi

git clone http://luajit.org/git/luajit-2.0.git "$DIR/luajit"
git clone https://github.com/letoram/openal.git "$DIR/openal"
git clone https://github.com/libuvc/libuvc.git "$DIR/libuvc"

0 comments on commit e02c29e

Please sign in to comment.