aboutsummaryrefslogtreecommitdiff
path: root/src/cpt-build
blob: b4c9dd9497eab503a2a7cc8210c027afe636ad8a (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
#!/bin/sh
# Build a package

# shellcheck disable=1091
if command -v cpt-lib >/dev/null; then . cpt-lib; else . ./cpt-lib; fi

eval set -- "$(getopt -l no-prompt,version,help -- yvh "$@")"
while :; do
    case "$1" in
        --help|-h)
            out "usage: ${0##*/} [pkg...]" "" \
                "  Options:" \
                "  -y --no-prompt  Do not prompt for confirmation" ""
            exit 1 ;;
        --version|-v) version ;;
        --no-prompt|-y) export CPT_PROMPT=0; shift ;;
        --) shift; break ;;
    esac
done

[ "$1" ] || set -- "${PWD##*/}"; export CPT_PATH=${PWD%/*}:$CPT_PATH

create_cache

pkg_build "$@"