hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/scripts/docker-entrypoint.sh
blob: fd65923bf0f28766fca67744d9f515cf9c583a3f (plain)
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
#!/bin/sh
set -eu

if [ "$#" -eq 0 ]; then
    set -- list
fi

target="$1"
shift

case "$target" in
    day[0-9]*)
        day="${target#day}"
        exec make run DAY="$day" "$@"
        ;;
    run-day[0-9]*)
        day="${target#run-day}"
        exec make run DAY="$day" "$@"
        ;;
    list)
        exec make list "$@"
        ;;
    *)
        exec make "$target" "$@"
        ;;
esac