chore: add Cloudron PackageTemplate, helper script; add .gitattributes/.editorconfig; refine .gitignore; improve workspace scripts

This commit is contained in:
2025-09-12 14:18:41 -05:00
parent 1a2f9bae6d
commit 8bb6d00b0f
14 changed files with 314 additions and 18 deletions

View File

@@ -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'