remove unused file '2'

main
Andre Challier 2026-01-11 18:47:29 +01:00
parent 6944591557
commit 1c7ebb90fd
1 changed files with 0 additions and 39 deletions

39
2
View File

@ -1,39 +0,0 @@
#!/bin/bash
#
# Initialize dadi staging folder from repository
#
# - delete existing dadi staging folder
#
HTML_HOME="/html"
BRANCHES_FOLDER="/html/branches"
DADI_STAGING_REPOSITORY="git_dadi-staging:AG-IT/KlDaDiSeite.git"
#
# Remove all branch folders
#
for dir in "$BRANCHES_FOLDER"/*/; do
dir_name=$(basename "$dir")
echo "Deleting directory: $dir"
rm -rf "$dir"
done
#
# Fetch all branch names
#
branches=()
while read -r ref; do
# Extract branch name from the reference
branch_name=$(echo "$ref" | awk '{print $2}' | sed 's/refs\/heads\///')
# put into array
branches+=("$branch_name")
done < <(git ls-remote --heads "$DADI_STAGING_REPOSITORY")
for branch in "${branches[@]}"; do
echo "cloning $branch"
git clone --depth 1 --branch "$branch" --single-branch "$DADI_STAGING_REPOSITORY" "$BRANCHES_FOLDER"/"$branch"
done