Doar line endings, zero modificari de continut (verificat cu
git diff --ignore-cr-at-eol: fara diferente ramase pe aceste fisiere).
Fisierele aveau CRLF comis efectiv in repo, nu doar in working tree.
Sunt scripturi care ruleaza pe Linux (migrarea Oracle, LXC 171 claude-agent),
iar deployate direct din working tree bash le refuza cu
"$'\r': command not found" - exact capcana pe care .gitattributes (comis in
9475842) o previne de acum inainte pentru fisierele noi.
Nu sunt incluse fisierele .md/.sql din roa-windows-setup: acelea au
modificari reale de continut, in curs, si apartin altui commit.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BhQBTegE4PiMPPaapLHjkc
105 lines
2.5 KiB
Bash
105 lines
2.5 KiB
Bash
#!/bin/bash
|
|
# Script all-in-one pentru workflow cu selecție proiect
|
|
|
|
WORKSPACE="/workspace"
|
|
source ~/.nvm/nvm.sh
|
|
|
|
echo "🚀 Claude Workflow"
|
|
echo "=================="
|
|
echo ""
|
|
|
|
# Listează proiectele (directoare cu .git)
|
|
echo "📁 Proiecte disponibile:"
|
|
echo ""
|
|
projects=()
|
|
i=1
|
|
for dir in "$WORKSPACE"/*/; do
|
|
if [ -d "$dir/.git" ]; then
|
|
name=$(basename "$dir")
|
|
projects+=("$dir")
|
|
echo " $i) $name"
|
|
((i++))
|
|
fi
|
|
done
|
|
|
|
if [ ${#projects[@]} -eq 0 ]; then
|
|
echo "❌ Nu am găsit proiecte Git în $WORKSPACE"
|
|
exit 1
|
|
fi
|
|
|
|
echo ""
|
|
read -p "Alege proiect [1-$((i-1))]: " proj_choice
|
|
|
|
if [ -z "$proj_choice" ] || [ "$proj_choice" -lt 1 ] || [ "$proj_choice" -gt ${#projects[@]} ]; then
|
|
echo "❌ Selecție invalidă"
|
|
exit 1
|
|
fi
|
|
|
|
PROJECT_DIR="${projects[$((proj_choice-1))]}"
|
|
PROJECT_NAME=$(basename "$PROJECT_DIR")
|
|
|
|
cd "$PROJECT_DIR" || exit 1
|
|
|
|
echo ""
|
|
echo "📂 Proiect: $PROJECT_NAME"
|
|
echo "🌿 Branch curent: $(git branch --show-current)"
|
|
echo ""
|
|
echo "Ce vrei să faci?"
|
|
echo " 1) Începe task nou (branch nou)"
|
|
echo " 2) Continuă task existent"
|
|
echo " 3) Finalizează task (commit + push)"
|
|
echo " 4) Vezi branch-uri"
|
|
echo " 5) Pornește Claude pe branch-ul curent"
|
|
echo ""
|
|
read -p "Alege [1-5]: " choice
|
|
|
|
case $choice in
|
|
1)
|
|
read -p "Nume branch (ex: fix/bug-login): " BRANCH_NAME
|
|
git checkout main 2>/dev/null || git checkout master
|
|
git pull
|
|
git checkout -b "$BRANCH_NAME"
|
|
echo "✅ Branch creat: $BRANCH_NAME"
|
|
echo "Pornesc Claude..."
|
|
claude
|
|
;;
|
|
2)
|
|
echo "Branch-uri locale:"
|
|
git branch
|
|
echo ""
|
|
read -p "Nume branch: " BRANCH_NAME
|
|
git checkout "$BRANCH_NAME"
|
|
echo "Pornesc Claude..."
|
|
claude
|
|
;;
|
|
3)
|
|
BRANCH=$(git branch --show-current)
|
|
if [ "$BRANCH" = "main" ] || [ "$BRANCH" = "master" ]; then
|
|
echo "❌ Ești pe $BRANCH! Nu face commit direct aici."
|
|
exit 1
|
|
fi
|
|
echo "📋 Status:"
|
|
git status --short
|
|
echo ""
|
|
read -p "Mesaj commit: " COMMIT_MSG
|
|
if [ -n "$COMMIT_MSG" ]; then
|
|
git add .
|
|
git commit -m "$COMMIT_MSG"
|
|
git push -u origin "$BRANCH"
|
|
echo "✅ Push făcut pe $BRANCH"
|
|
fi
|
|
;;
|
|
4)
|
|
echo "Branch curent: $(git branch --show-current)"
|
|
echo ""
|
|
git branch -a
|
|
;;
|
|
5)
|
|
echo "Pornesc Claude pe $(git branch --show-current)..."
|
|
claude
|
|
;;
|
|
*)
|
|
echo "Opțiune invalidă"
|
|
;;
|
|
esac
|