-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev(anni): add kitty script for dev setup
- Loading branch information
1 parent
0335923
commit d5847d0
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/sh | ||
|
||
if [ "$1" = "-h" -o "$1" = "--help" ]; then | ||
echo 'Annotation dev setup for kitty terminal' | ||
echo ' Starts the Annotation Interface, Server and their databases in split windows.' | ||
echo " Run from the repository's root." | ||
echo '' | ||
echo 'optional arguments:' | ||
echo ' -h, --help show this message and exit' | ||
echo ' -s, --server run the Annotation Server instead of the Interface (default)' | ||
echo ' in the tallest window' | ||
exit 0 | ||
fi | ||
|
||
if [ "$TERM" != "xterm-kitty" ]; then | ||
echo 'Unsupported terminal.' | ||
exit 1 | ||
fi | ||
|
||
if [ ! -d annotation-interface -o ! -d annotation-server ]; then | ||
echo "Run from the repository's root." | ||
exit 1 | ||
fi | ||
|
||
|
||
CWD=`pwd` | ||
|
||
AS=('cd annotation-server && yarn start:dev' 'cd annotation-server && docker compose up') | ||
AI=('cd annotation-interface && yarn dev' 'cd annotation-interface && docker compose up') | ||
|
||
if [ "$1" = "-s" -o "$1" = "--server" ]; then | ||
MAIN=("${AS[@]}") | ||
SEC=("${AI[@]}") | ||
else | ||
MAIN=("${AI[@]}") | ||
SEC=("${AS[@]}") | ||
fi | ||
|
||
kitty @ launch --cwd=$CWD --location=vsplit &>/dev/null && kitty @ send-text "${SEC[0]}\n" | ||
kitty @ launch --cwd=$CWD --location=hsplit &>/dev/null && kitty @ send-text "${SEC[1]}\n" | ||
kitty @ launch --cwd=$CWD --location=hsplit &>/dev/null && kitty @ send-text "${MAIN[1]}\n" | ||
eval "${MAIN[0]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters