mirror of
https://github.com/chocolate-doom/chocpkg.git
synced 2025-02-02 05:21:55 +00:00
Replace case with if and [[ = syntax.
This commit is contained in:
parent
0225fd6f7d
commit
158133572f
1 changed files with 3 additions and 4 deletions
|
@ -6,7 +6,7 @@ set -eu
|
||||||
# path where the script is located.
|
# path where the script is located.
|
||||||
set_chocpkg_root() {
|
set_chocpkg_root() {
|
||||||
# Assume that the package root is one directory up from the script.
|
# Assume that the package root is one directory up from the script.
|
||||||
if [[ $0 = /* ]]; then
|
if [[ "$0" = /* ]]; then
|
||||||
local script_path="$0"
|
local script_path="$0"
|
||||||
else
|
else
|
||||||
local script_path="$PWD/${0#./}"
|
local script_path="$PWD/${0#./}"
|
||||||
|
@ -15,8 +15,7 @@ set_chocpkg_root() {
|
||||||
CHOCPKG_ROOT=$(dirname "$script_dir")
|
CHOCPKG_ROOT=$(dirname "$script_dir")
|
||||||
|
|
||||||
# Build directory must not contain a space, or bad things happen:
|
# Build directory must not contain a space, or bad things happen:
|
||||||
case "$CHOCPKG_ROOT" in
|
if [[ "$CHOCPKG_ROOT" = *\ * ]]; then
|
||||||
*\ *)
|
|
||||||
cat <<END
|
cat <<END
|
||||||
The build scripts are in a path containing a space:
|
The build scripts are in a path containing a space:
|
||||||
|
|
||||||
|
@ -26,7 +25,7 @@ set_chocpkg_root() {
|
||||||
different directory not containing a space.
|
different directory not containing a space.
|
||||||
END
|
END
|
||||||
exit 1
|
exit 1
|
||||||
esac
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# basic_setup is invoked on script startup to set various environment variables
|
# basic_setup is invoked on script startup to set various environment variables
|
||||||
|
|
Loading…
Reference in a new issue