summaryrefslogtreecommitdiffhomepage
path: root/make-tar.sh
blob: abb83fddb31b0e01c35b34b0e7618d46f10813c8 (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
27
28
29
30
31
32
33
34
35
#!/bin/sh

prefix="$1"
filename="$2"
bin="$3"

branch="$(git rev-parse --abbrev-ref HEAD)"

cmake --build "$bin" --target install -- -j4 || exit 1

if : &&
    cd $(dirname -- "${prefix}") &&
    zip -9r "${filename}" $(basename "${prefix}")
then
    case "$branch" in
    unstable)
        case "$USER,$(uname -s)" in
            # for the script see https://github.com/andreafabrizi/Dropbox-Uploader
            sthalik,CYGWIN_*)
                dropbox_uploader.sh -p upload "$filename" /
                bn="$(basename -- "$filename")"
                l="$(dropbox_uploader.sh -q share /"$bn")"
                test -n "$l" && echo -n "$l" | putclip
                echo $l
                echo -ne '\a' ;;
            *) ls -lh -- "${filename}" ;;
        esac ;;
    *) ;;
    esac
else
    rm -fv -- "${filename}"
    exit 1
fi

exit 0