Merge pull request 'fixed incorrect work dir flag and added new flag for editor specification' (#1) from devel into main
Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
commit
108080a743
1 file changed
+11
-4
+11
-4
@@ -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
|
||||||
}
|
}
|
||||||
@@ -58,11 +61,15 @@ while [[ "$#" -gt 0 ]]; do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
"--cwd"|"--dir")
|
"--cwd"|"-c")
|
||||||
CWD="$2"
|
CWD="$2"
|
||||||
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