From 60733bc0330254105f0916f8ae842c2777bf26ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Sat, 11 May 2024 18:06:12 +0200 Subject: [PATCH] Remove redundant check for existing directory with `mkdir -p` The `mkdir -p` command is already idempotent so separately checking whether the directory exists is not necessary. --- scripts/compile_libs/gen_libs.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/compile_libs/gen_libs.sh b/scripts/compile_libs/gen_libs.sh index 8a5b13843..4cfd72ddb 100755 --- a/scripts/compile_libs/gen_libs.sh +++ b/scripts/compile_libs/gen_libs.sh @@ -153,9 +153,7 @@ function _copy_sdl() { mkdir -p ddnet-libs/sdl/"$OS_NAME"/lib"$2" cp compile_libs/sdl/build_"$OS_NAME"_"$1"/libSDL2.a ddnet-libs/sdl/"$OS_NAME"/lib"$2"/libSDL2.a cp compile_libs/sdl/build_"$OS_NAME"_"$1"/libSDL2main.a ddnet-libs/sdl/"$OS_NAME"/lib"$2"/libSDL2main.a - if [ ! -d "ddnet-libs/sdl/include/$OS_NAME" ]; then - mkdir -p ddnet-libs/sdl/include/"$OS_NAME" - fi + mkdir -p ddnet-libs/sdl/include/"$OS_NAME" cp -R compile_libs/sdl/include/* ddnet-libs/sdl/include/"$OS_NAME" }