feat: INITIAL COMMIT

This commit is contained in:
TakshakRamteke committed 2026-09-26 02:29:19 +05:30
1 parent bd8ed719bc
commit f044c5f354
1 file changed
+77
+77
View File
@@ -0,0 +1,77 @@
#!/bin/bash
CWD="$PWD"
TICKETS=()
function ticketloop(){
for args in "${TICKETS[@]}"; do
IFS='|' read -r label ticket prompt <<< "$args"
case $label in
"feature"|"hotfix")
doaction "$label" "$ticket" "dev" "$prompt"
;;
"fix")
doaction "$label" "$ticket" "dev" "$prompt"
;;
*)
doaction "$label" "$ticket" "dev" "$prompt"
;;
esac
done
}
function doaction {
local label=$1
local ticket=$2
local from=$3
local prompt=$4
branch="godb_$label_$ticket"
dir="../godb_$ticket"
echo "----------------------------------------"
echo "Creating workspace with the following details: "
echo "Ticket Type : $label"
echo "Ticket Id : $ticket"
echo "Ticket branch: $branch"
echo "Worktree dir : $dir"
echo "Branch from : $from"
echo "Prompt : $prompt"
echo "----------------------------------------"
git checkout "$from"
git pull origin "$from"
git worktree add "$dir" -b "$branch"
cd "$dir"
code .
sleep 1.5
code chat "$prompt"
cd "$CWD"
git worktree list
}
while [[ "$#" -gt 0 ]]; do
case "$1" in
"--ticket"|"-t")
shift
while [[ "$#" -gt 0 && ! "$1" =~ ^- ]];do
TICKETS+=("$1")
shift
done
;;
"--cwd"|"--dir")
CWD="$2"
cd "$2"
shift 2
;;
*)
echo "unknown argument $1"
exit -1
;;
esac
done
echo "CWD: $CWD"
echo "TICKETS: ${TICKETS[@]}"
ticketloop