forked from armbian/build
-
Notifications
You must be signed in to change notification settings - Fork 22
/
compile.sh
executable file
·44 lines (33 loc) · 1.21 KB
/
compile.sh
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
#!/bin/bash
#
# Copyright (c) 2013-2021 Igor Pecovnik, igor.pecovnik@gma**.com
#
# This file is licensed under the terms of the GNU General Public
# License version 2. This program is licensed "as is" without any
# warranty of any kind, whether express or implied.
#
# This file is a part of the Armbian build script
# https://github.com/armbian/build/
# DO NOT EDIT THIS FILE
# use configuration files like config-default.conf to set the build configuration
# check Armbian documentation https://docs.armbian.com/ for more info
SRC="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
# check for whitespace in ${SRC} and exit for safety reasons
grep -q "[[:space:]]" <<< "${SRC}" && {
echo "\"${SRC}\" contains whitespace. Not supported. Aborting." >&2
exit 1
}
cd "${SRC}" || exit
if [[ -f "${SRC}"/lib/import-functions.sh ]]; then
# Declare this folder as safe
if ! grep -q "directory = \*" "$HOME/.gitconfig" 2> /dev/null; then
git config --global --add safe.directory "*"
fi
# shellcheck source=lib/import-functions.sh
source "${SRC}"/lib/import-functions.sh
else
echo "Error: missing build directory structure"
echo "Please clone the full repository https://github.com/armbian/build/"
exit 255
fi
cli_entrypoint "$@"