feat: added flag to specify editor of choice
This commit is contained in:
1 parent
daa0031ca0
commit
3e2791269d
1 file changed
+10
-3
+10
-3
@@ -1,6 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
CWD="$PWD"
|
CWD="$PWD"
|
||||||
|
EDITOR="code"
|
||||||
TICKETS=()
|
TICKETS=()
|
||||||
|
|
||||||
function ticketloop(){
|
function ticketloop(){
|
||||||
@@ -29,7 +30,7 @@ function doaction {
|
|||||||
branch="godb_$label_$ticket"
|
branch="godb_$label_$ticket"
|
||||||
dir="../godb_$ticket"
|
dir="../godb_$ticket"
|
||||||
|
|
||||||
echo "----------------------------------------"
|
echo "-----------------------------------------------"
|
||||||
echo "Creating workspace with the following details: "
|
echo "Creating workspace with the following details: "
|
||||||
echo "Ticket Type : $label"
|
echo "Ticket Type : $label"
|
||||||
echo "Ticket Id : $ticket"
|
echo "Ticket Id : $ticket"
|
||||||
@@ -37,14 +38,16 @@ function doaction {
|
|||||||
echo "Worktree dir : $dir"
|
echo "Worktree dir : $dir"
|
||||||
echo "Branch from : $from"
|
echo "Branch from : $from"
|
||||||
echo "Prompt : $prompt"
|
echo "Prompt : $prompt"
|
||||||
echo "----------------------------------------"
|
echo "-----------------------------------------------"
|
||||||
git checkout "$from"
|
git checkout "$from"
|
||||||
git pull origin "$from"
|
git pull origin "$from"
|
||||||
git worktree add "$dir" -b "$branch"
|
git worktree add "$dir" -b "$branch"
|
||||||
cd "$dir"
|
cd "$dir"
|
||||||
code .
|
"$EDITOR" . &
|
||||||
sleep 1.5
|
sleep 1.5
|
||||||
|
if [[ -n "$prompt" && "$EDITOR" == "code" ]]; then
|
||||||
code chat "$prompt"
|
code chat "$prompt"
|
||||||
|
fi
|
||||||
cd "$CWD"
|
cd "$CWD"
|
||||||
git worktree list
|
git worktree list
|
||||||
}
|
}
|
||||||
@@ -63,6 +66,10 @@ while [[ "$#" -gt 0 ]]; do
|
|||||||
cd "$2"
|
cd "$2"
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
|
"--edr"|"-e")
|
||||||
|
EDITOR="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "unknown argument $1"
|
echo "unknown argument $1"
|
||||||
exit -1
|
exit -1
|
||||||
|
|||||||
Reference in new issue
Block a user