chore: add Cloudron PackageTemplate, helper script; add .gitattributes/.editorconfig; refine .gitignore; improve workspace scripts
This commit is contained in:
@@ -27,18 +27,21 @@ set -o nounset
|
||||
set -o pipefail
|
||||
set -o functrace
|
||||
|
||||
WORKDIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
TARGET_DIR="${WORKDIR}/Docker"
|
||||
|
||||
cd Docker
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
GIT_REPO_LIST="$(ls -d */)"
|
||||
|
||||
IFS=$'\n\t'
|
||||
|
||||
for GIT_REPO in ${GIT_REPO_LIST[@]};
|
||||
do
|
||||
CURRENT_DIR=$(realpath $PWD)
|
||||
echo "Updating from $GIT_REPO..."
|
||||
cd $GIT_REPO
|
||||
git pull
|
||||
cd $CURRENT_DIR
|
||||
done
|
||||
# Iterate only over directories that are git repos
|
||||
while IFS= read -r -d '' repo_dir; do
|
||||
echo "Updating: ${repo_dir}"
|
||||
pushd "$repo_dir" >/dev/null
|
||||
if [[ -d .git ]]; then
|
||||
git -c advice.detachedHead=false fetch --all --prune || true
|
||||
# Fast-forward only to avoid unintended merges
|
||||
git -c advice.detachedHead=false pull --ff-only || true
|
||||
else
|
||||
echo "Skipping (not a git repo): ${repo_dir}"
|
||||
fi
|
||||
popd >/dev/null
|
||||
done < <(find . -mindepth 1 -maxdepth 1 -type d -print0)
|
||||
|
Reference in New Issue
Block a user