mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2025-02-20 11:43:27 +08:00
run.sh: Improve compatibility with other systems (#1332)
* run.sh: Improve compatibility with other systems For example $OSTYPE is empty in OpenBSD and the script fallsback to Linux option, with nproc isn't present it fails to build. * Update run.sh --------- Co-authored-by: Carter Li <CarterLi@users.noreply.github.com>
This commit is contained in:
parent
af09de319b
commit
99c0e9e719
22
run.sh
22
run.sh
@ -5,18 +5,22 @@ set -e
|
||||
mkdir -p build/
|
||||
cd build/
|
||||
|
||||
if [ -z "${CMAKE_BUILD_TYPE}" ]; then
|
||||
CMAKE_BUILD_TYPE=Release
|
||||
fi
|
||||
cmake "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" ..
|
||||
cmake ..
|
||||
|
||||
if [ -z "$OSTYPE" ] || [ "$OSTYPE" = "linux-gnu" ]; then
|
||||
kernel_name="$(uname -s)"
|
||||
|
||||
case "${kernel_name}" in
|
||||
"Linux" | "MINGW"*)
|
||||
cmake_build_args="-j$(nproc)"
|
||||
elif [ "$OSTYPE" = "darwin" ]; then
|
||||
;;
|
||||
"Darwin" | *"BSD" | "DragonFly")
|
||||
cmake_build_args="-j$(sysctl -n hw.ncpu)"
|
||||
else
|
||||
;;
|
||||
*)
|
||||
cmake_build_args=""
|
||||
fi
|
||||
cmake --build . --target fastfetch ${cmake_build_args}
|
||||
;;
|
||||
esac
|
||||
|
||||
cmake --build . --target fastfetch "${cmake_build_args}"
|
||||
|
||||
./fastfetch "$@"
|
||||
|
Loading…
x
Reference in New Issue
Block a user