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 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>
27 lines
414 B
Bash
Executable File
27 lines
414 B
Bash
Executable File
#!/usr/bin/env sh
|
|
|
|
set -e
|
|
|
|
mkdir -p build/
|
|
cd build/
|
|
|
|
cmake ..
|
|
|
|
kernel_name="$(uname -s)"
|
|
|
|
case "${kernel_name}" in
|
|
"Linux" | "MINGW"*)
|
|
cmake_build_args="-j$(nproc)"
|
|
;;
|
|
"Darwin" | *"BSD" | "DragonFly")
|
|
cmake_build_args="-j$(sysctl -n hw.ncpu)"
|
|
;;
|
|
*)
|
|
cmake_build_args=""
|
|
;;
|
|
esac
|
|
|
|
cmake --build . --target fastfetch "${cmake_build_args}"
|
|
|
|
./fastfetch "$@"
|