fixed incorrect work dir flag and added new flag for editor specification #1

Merged
TakshakRamteke merged 2 commits from devel into main 2026-09-27 17:51:56 +00:00
+11 -4
View File
@@ -1,6 +1,7 @@
#!/bin/bash
CWD="$PWD"
EDITOR="code"
TICKETS=()
function ticketloop(){
@@ -29,7 +30,7 @@ function doaction {
branch="godb_$label_$ticket"
dir="../godb_$ticket"
echo "----------------------------------------"
echo "-----------------------------------------------"
echo "Creating workspace with the following details: "
echo "Ticket Type : $label"
echo "Ticket Id : $ticket"
@@ -37,14 +38,16 @@ function doaction {
echo "Worktree dir : $dir"
echo "Branch from : $from"
echo "Prompt : $prompt"
echo "----------------------------------------"
echo "-----------------------------------------------"
git checkout "$from"
git pull origin "$from"
git worktree add "$dir" -b "$branch"
cd "$dir"
code .
"$EDITOR" . &
sleep 1.5
if [[ -n "$prompt" && "$EDITOR" == "code" ]]; then
code chat "$prompt"
fi
cd "$CWD"
git worktree list
}
@@ -58,11 +61,15 @@ while [[ "$#" -gt 0 ]]; do
shift
done
;;
"--cwd"|"--dir")
"--cwd"|"-c")
CWD="$2"
cd "$2"
shift 2
;;
"--edr"|"-e")
EDITOR="$2"
shift 2
;;
*)
echo "unknown argument $1"
exit -1