From a7debb234aacf467c3097c5aea79bebf3e0303d9 Mon Sep 17 00:00:00 2001
From: Joseph Walton-Rivers <joseph@walton-rivers.uk>
Date: Sun, 5 Sep 2021 11:03:53 +0100
Subject: [PATCH] don't prompt for admin password if not needed

---
 build.sh | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/build.sh b/build.sh
index fbd3523..e2bb125 100755
--- a/build.sh
+++ b/build.sh
@@ -9,9 +9,11 @@ then
 	mkdir build
 fi
 
-sudo dnf install -y cmake
-sudo dnf install -y wayland-devel libxkbcommon-devel wayland-protocols-devel extra-cmake-modules
-sudo dnf install -y glew-devel glm-devel
+if [ ! -x "$(command -v cmake)" ]; then
+	sudo dnf install -y cmake extra-cmake-modules
+	sudo dnf install -y wayland-devel libxkbcommon-devel wayland-protocols-devel
+	sudo dnf install -y glew-devel glm-devel
+fi
 
 # if doing shader development, disable the cache to make sure changes take affect
 rm -rf $CACHE
-- 
GitLab