Actualizar lib/steps/repos.sh
This commit is contained in:
parent
bf7bdfa4d7
commit
24dacb2e33
1 changed files with 46 additions and 2 deletions
|
|
@ -12,14 +12,31 @@ step_repos() {
|
|||
}
|
||||
|
||||
_clone_repos() {
|
||||
echo ""
|
||||
log_info "REPOS CONFIG:"
|
||||
for name in core essentials cli gui; do
|
||||
local url="${REPO_URLS[$name]}"
|
||||
local branch="${REPO_BRANCHES[$name]}"
|
||||
local dest="${REPO_DIRS[$name]}"
|
||||
echo " $name:"
|
||||
echo " URL: $url"
|
||||
echo " Branch: $branch"
|
||||
echo " Dest: $dest"
|
||||
done
|
||||
echo ""
|
||||
|
||||
for name in core essentials cli gui; do
|
||||
local url="${REPO_URLS[$name]}"
|
||||
local branch="${REPO_BRANCHES[$name]}"
|
||||
local dest="${REPO_DIRS[$name]}"
|
||||
|
||||
log_info "Processing ${name}..."
|
||||
log_info " Checking if exists: $dest/.git"
|
||||
|
||||
if [ -d "$dest/.git" ]; then
|
||||
log_warn "Repository already exists: ${dest}"
|
||||
if ask_confirm "Delete and re-clone ${name}?"; then
|
||||
log_info "Deleting: $dest"
|
||||
rm -rf "$dest"
|
||||
else
|
||||
log_skip "Re-clone skipped — using ${dest}"
|
||||
|
|
@ -27,22 +44,49 @@ _clone_repos() {
|
|||
fi
|
||||
fi
|
||||
|
||||
log_info "Starting clone..."
|
||||
log_info " git clone --branch $branch $url $dest"
|
||||
|
||||
start_spinner "Cloning ${name} (branch: ${branch})..."
|
||||
|
||||
local clone_log="/tmp/clone_${name}_$$.log"
|
||||
if ! git clone --branch "$branch" "$url" "$dest" > "$clone_log" 2>&1; then
|
||||
stop_spinner
|
||||
log_error "git clone failed: ${url}"
|
||||
cat "$clone_log"
|
||||
log_error "git clone FAILED for ${name}"
|
||||
log_error "URL: $url"
|
||||
log_error "Branch: $branch"
|
||||
log_error "Dest: $dest"
|
||||
log_error "Output:"
|
||||
cat "$clone_log" | sed 's/^/ /'
|
||||
rm -f "$clone_log"
|
||||
exit 1
|
||||
fi
|
||||
rm -f "$clone_log"
|
||||
|
||||
log_info "Checking if clone succeeded: ls -la $dest/.git"
|
||||
if [ ! -d "$dest/.git" ]; then
|
||||
stop_spinner
|
||||
log_error "${name} clone directory exists but no .git found"
|
||||
ls -la "$dest" 2>&1 | sed 's/^/ /'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
stop_spinner "${name} cloned → ${dest}"
|
||||
chmod 700 "$dest"
|
||||
log_ok "${name} OK"
|
||||
done
|
||||
|
||||
echo ""
|
||||
log_info "FINAL CHECK:"
|
||||
for name in core essentials cli gui; do
|
||||
local dest="${REPO_DIRS[$name]}"
|
||||
if [ -d "$dest/.git" ]; then
|
||||
log_ok "$name: ✓ cloned at $dest"
|
||||
else
|
||||
log_error "$name: ✗ NOT cloned — $dest/.git missing"
|
||||
fi
|
||||
done
|
||||
echo ""
|
||||
if [ ! -d "$HV_CORE/.git" ]; then
|
||||
log_error "core repository not cloned"
|
||||
exit 1
|
||||
|
|
|
|||
Loading…
Reference in a new issue