Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
cmake_build_args="-j$(nproc)"
elif [ "$OSTYPE" = "darwin" ]; then
cmake_build_args="-j$(sysctl -n hw.ncpu)"
else
cmake_build_args=""
fi
cmake --build . --target fastfetch ${cmake_build_args}
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 "$@"
Loading