diff --git a/tests/real_world/.gitignore b/tests/real_world/.gitignore new file mode 100644 index 0000000..4217392 --- /dev/null +++ b/tests/real_world/.gitignore @@ -0,0 +1,3 @@ +/* +!.gitignore +!clone.sh \ No newline at end of file diff --git a/tests/real_world/clone.sh b/tests/real_world/clone.sh new file mode 100755 index 0000000..15403a0 --- /dev/null +++ b/tests/real_world/clone.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# It's like git submodules without the git submodules part. + +set -euo pipefail + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +ensure_cloned() { + if [ ! -d "$1" ]; then + git clone "$1" "$SCRIPT_DIR/$2" + fi + + (cd "$SCRIPT_DIR/$2" && git checkout "$3") +} + +ensure_cloned "https://github.com/tsoding/noed.git" "tsoding_noed" "1c2bd182139080a8448a59589e8d457a7019d553"