From 1ec13fd4243206fa027ad9d1f92a038f22550ab4 Mon Sep 17 00:00:00 2001
From: Philipp Bringmann <philipp.bringmann@tuwien.ac.at>
Date: Wed, 9 Aug 2023 23:51:42 +0200
Subject: [PATCH] Make getHostname Mac-compatible

---
 lib/storage/getHostname.m | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/storage/getHostname.m b/lib/storage/getHostname.m
index 7547158..dd77b97 100644
--- a/lib/storage/getHostname.m
+++ b/lib/storage/getHostname.m
@@ -19,19 +19,19 @@ function hostname = getHostname()
 %
 
 
-    % Read hostname
-    if isunix()
-        [~, hostname] = system('cat /etc/hostname');
-        hostname = hostname(1:end-1);
-    elseif ispc()
+    %% READ HOSTNAME
+    if ispc()
         hostname = 'win';
     elseif ismac()
         hostname = 'mac';
+    elseif isunix()
+        [~, hostname] = system('cat /etc/hostname');
+        hostname = hostname(1:end-1);
     else
         hostname = 'unknown';
     end
 
-    % Check result
+    %% CHECK RESULT
     if isempty(hostname)
         hostname = 'no_hostname';
     end
-- 
GitLab