diff options
| author | Mehmet Samet Duman <yongdohyun@projecttick.org> | 2026-04-02 18:43:51 +0300 |
|---|---|---|
| committer | Mehmet Samet Duman <yongdohyun@projecttick.org> | 2026-04-02 18:43:51 +0300 |
| commit | b85e90fc3480da0e6a48da73201a0b22488cc650 (patch) | |
| tree | 42b2e083e7d268747b01a03c0bedb48a9394585e /meta/init.sh | |
| parent | 5c7048091e3a191e8a34f26852a8976b254e339b (diff) | |
| parent | f88d1f18953f9619444d56756702c7eb54580ab1 (diff) | |
| download | Project-Tick-b85e90fc3480da0e6a48da73201a0b22488cc650.tar.gz Project-Tick-b85e90fc3480da0e6a48da73201a0b22488cc650.zip | |
Add 'meta/' from commit 'f88d1f18953f9619444d56756702c7eb54580ab1'
git-subtree-dir: meta
git-subtree-mainline: 5c7048091e3a191e8a34f26852a8976b254e339b
git-subtree-split: f88d1f18953f9619444d56756702c7eb54580ab1
Diffstat (limited to 'meta/init.sh')
| -rw-r--r-- | meta/init.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/meta/init.sh b/meta/init.sh new file mode 100644 index 0000000000..c9bfa8133f --- /dev/null +++ b/meta/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 $3" >&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" |
