chore: add Cloudron PackageTemplate, helper script; add .gitattributes/.editorconfig; refine .gitignore; improve workspace scripts
This commit is contained in:
@@ -205,10 +205,25 @@ https://github.com/funmusicplace/mirlo.git
|
||||
|
||||
)
|
||||
|
||||
cd Docker
|
||||
WORKDIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
TARGET_DIR="${WORKDIR}/Docker"
|
||||
mkdir -p "$TARGET_DIR"
|
||||
|
||||
IFS=$'\n\t'
|
||||
# If REPOS.txt exists, read additional repos (lines; ignore # and blanks)
|
||||
EXTRA_REPOS_FILE="${WORKDIR}/REPOS.txt"
|
||||
if [[ -f "$EXTRA_REPOS_FILE" ]]; then
|
||||
mapfile -t EXTRA_REPOS < <(sed -e 's/#.*$//' -e '/^\s*$/d' "$EXTRA_REPOS_FILE")
|
||||
else
|
||||
EXTRA_REPOS=()
|
||||
fi
|
||||
|
||||
for GIT_REPO in ${GIT_REPO_LIST[@]};do
|
||||
git clone --depth 1 $GIT_REPO || true
|
||||
done
|
||||
ALL_REPOS=("${GIT_REPO_LIST[@]}" "${EXTRA_REPOS[@]}")
|
||||
|
||||
echo "Cloning to: $TARGET_DIR"
|
||||
printf ' - %s\n' "${ALL_REPOS[@]}"
|
||||
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
# Parallel clones (default 4 jobs). Avoid failing the whole script on single failures.
|
||||
JOBS="${JOBS:-4}"
|
||||
printf '%s\n' "${ALL_REPOS[@]}" | xargs -n1 -P "$JOBS" -I{} bash -lc 'repo="{}"; name=$(basename -s .git "$repo"); if [[ -d "$name/.git" ]]; then echo "exists: $name"; else git clone --depth 1 "$repo" "$name" || echo "failed: $repo"; fi'
|
||||
|
Reference in New Issue
Block a user