From f503e436f913b18eee7e4f45aa235e7706bf4bb5 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sat, 18 Mar 2023 02:36:25 +0200
Subject: [PATCH 8/8] installer_build.sh: Add error handling for failed mkdir

See osdn #46611

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 windows/installer_cross/installer_build.sh | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/windows/installer_cross/installer_build.sh b/windows/installer_cross/installer_build.sh
index bf1aa3ee62..a20ba03161 100755
--- a/windows/installer_cross/installer_build.sh
+++ b/windows/installer_cross/installer_build.sh
@@ -1,4 +1,17 @@
 #!/bin/bash
+#/***********************************************************************
+# Freeciv - Copyright (C) 2017-2023
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2, or (at your option)
+#   any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#***********************************************************************/
 
 add_glib_env() {
   mkdir -p $2/share/glib-2.0/schemas &&
@@ -313,7 +326,10 @@ else
     fi
   fi
 
-  mkdir -p Output
+  if ! mkdir -p Output ; then
+    echo "Cannot create Output directory" >&2
+    exit 1
+  fi
   if ! makensis Freeciv-$SETUP-$VERREV-$GUI.nsi
   then
     echo "Creating installer failed!" >&2
-- 
2.39.2