mirror of
https://github.com/eth-p/bat-extras.git
synced 2024-12-13 09:40:42 +01:00
Add verification to build script
This commit is contained in:
parent
7e4d8257fd
commit
efbf911f82
@ -60,3 +60,9 @@ If you only want to install a single script, you can run the build process and c
|
||||
Depending on the distribution, bat may have been renamed to avoid package conflicts.
|
||||
If you wish to use these scripts on a distribution where this is the case, there is an `--alternate-executable=NAME` option which will build the scripts to use an alternate executable name.
|
||||
|
||||
|
||||
|
||||
**Verification:**
|
||||
|
||||
The build script will attempt to verify the correctness of the "bin" scripts by comparing their output with their source counterparts. It is recommended to let it do this, but you can disable verification with the `--no-verify` option.
|
||||
|
||||
|
11
build.sh
11
build.sh
@ -180,6 +180,7 @@ pp_minify() {
|
||||
# -----------------------------------------------------------------------------
|
||||
# Options.
|
||||
OPT_INSTALL=false
|
||||
OPT_VERIFY=true
|
||||
OPT_MINIFY="lib"
|
||||
OPT_PREFIX="/usr/local"
|
||||
OPT_BAT="bat"
|
||||
@ -193,6 +194,7 @@ while shiftopt; do
|
||||
--prefix) shiftval; OPT_PREFIX="$OPT_VAL";;
|
||||
--alternate-executable) shiftval; OPT_BAT="$OPT_VAL";;
|
||||
--minify) shiftval; OPT_MINIFY="$OPT_VAL";;
|
||||
--no-verify) shiftval; OPT_VERIFY=false;;
|
||||
--docs:url) shiftval; DOCS_URL="$OPT_VAL";;
|
||||
--docs:maintainer) shiftval; DOCS_MAINTAINER="$OPT_VAL";;
|
||||
|
||||
@ -240,7 +242,6 @@ done
|
||||
# -----------------------------------------------------------------------------
|
||||
# Build files.
|
||||
|
||||
|
||||
printc "%{YELLOW}Building scripts...%{CLEAR}\n" 1>&2
|
||||
file_i=0
|
||||
file_n="${#SOURCES[@]}"
|
||||
@ -258,4 +259,12 @@ for file in "${SOURCES[@]}"; do
|
||||
cat >/dev/null
|
||||
done
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Verify files by running the tests.
|
||||
|
||||
if "$OPT_VERIFY"; then
|
||||
printc "\n%{YELLOW}Verifying scripts...%{CLEAR}\n" 1>&2
|
||||
"$HERE/test/run.sh" consistency-test
|
||||
exit $?
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user