#!/usr/bin/env elvish
fn run {
clear
docker compose up --build
}
fn run_air {
clear
docker compose -f ./docker-compose.dev.yaml up
}
fn clean {
clear
docker compose down
docker volume rm tixe_tixedb_data
}
fn docker_menu {
var input
while (not-eq $input "b") {
echo "[R]un, Run [A]ir, [C]lean, [B]ack"
set input = (sh -c 'read -n1 && echo $REPLY' | take 1)
if (eq $input "r") {
run
} elif (eq $input "a") {
run_air
} elif (eq $input "c") {
clean
}
}
}
fn tailwind_watch {
clear
tailwindcss -i input.css -o ./static/styles.css --watch
}
var input
while (not-eq $input "q") {
clear
echo "[D]ev Deploy, [T]ailwind Watch, [Q]uit"
set input = (sh -c 'read -n1 && echo $REPLY' | take 1)
if (eq $input "d") {
docker_menu
} elif (eq $input "t") {
tailwind_watch
}
}