diff options
| author | Trial97 <alexandru.tripon97@gmail.com> | 2024-04-27 23:19:54 +0300 |
|---|---|---|
| committer | Trial97 <alexandru.tripon97@gmail.com> | 2024-04-27 23:19:54 +0300 |
| commit | 2eecce37d3e8f16eeae1fbe51eb39f577e30b17b (patch) | |
| tree | f48e24203446ada81c736d3eb7ebc6a54c2fb320 /init.sh | |
| parent | d996dc2a20c8664b03259cead7c888fd85d9848c (diff) | |
| parent | d215ec0383ce130d2244a3bfe4567d56f3982701 (diff) | |
| download | Project-Tick-2eecce37d3e8f16eeae1fbe51eb39f577e30b17b.tar.gz Project-Tick-2eecce37d3e8f16eeae1fbe51eb39f577e30b17b.zip | |
Merge branch 'main' of https://github.com/PrismLauncher/meta into javas
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'init.sh')
| -rw-r--r-- | init.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/init.sh b/init.sh new file mode 100644 index 0000000000..815b5dcba3 --- /dev/null +++ b/init.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +set -ex + +if [ -f config.sh ]; then + source config.sh +fi + +export META_CACHE_DIR=${CACHE_DIRECTORY:-./caches} +export META_UPSTREAM_DIR=${META_UPSTREAM_DIR:-${STATE_DIRECTORY:-.}/upstream} +export META_LAUNCHER_DIR=${META_LAUNCHER_DIR:-${STATE_DIRECTORY:-.}/launcher} + +function init_repo { + # no op if target already exists + if [ -d "$1" ]; then + return 0 + fi + + # fail if no repo url is specified + if [ -z "$2" ]; then + echo "Can't initialize missing $1 directory. Please specify $4" >&2 + return 1 + fi + + git clone "$2" "$1" +} + +init_repo "$META_UPSTREAM_DIR" "$META_UPSTREAM_URL" "META_UPSTREAM_URL" +init_repo "$META_LAUNCHER_DIR" "$META_LAUNCHER_URL" "META_LAUNCHER_URL" |
