DEVELOPMENT ENVIRONMENT

~liljamo/tixe

ref: ce2cabfb0af53015630df7c353f1307783aa39e0 tixe/dev.elv -rwxr-xr-x 798 bytes
ce2cabfbJonni Liljamo feat: tags link, username group width fix 1 year, 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env elvish

fn run {
    clear
    docker compose up --build
}

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, [C]lean, [B]ack"
        set input = (sh -c 'read -n1 && echo $REPLY' | take 1)

        if (eq $input "r") {
            run
        } 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
    }
}