From 9d1400063ae58ccfcb35669249f799abcd725be5 Mon Sep 17 00:00:00 2001
From: nrb <freifunk@nicoboehr.de>
Date: Tue, 17 Nov 2020 20:57:21 +0100
Subject: [PATCH] make script executable

---
 download-experimental.sh          |  0
 download-latest-firmware-build.py | 10 +++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)
 mode change 100644 => 100755 download-experimental.sh

diff --git a/download-experimental.sh b/download-experimental.sh
old mode 100644
new mode 100755
diff --git a/download-latest-firmware-build.py b/download-latest-firmware-build.py
index dc14291..22335fd 100755
--- a/download-latest-firmware-build.py
+++ b/download-latest-firmware-build.py
@@ -65,6 +65,10 @@ for job in pipeline_jobs:
 
             with zipfile.ZipFile(artifact_temp) as artifact_zip:
                 version = find_version_from_archive(artifact_zip.infolist())
-                print(f"Version is {version}")
-                artifact_zip.extractall("gluon/output/")
-                os.rename("gluon/output", version)
+                if not os.path.exists(version):
+                    print(version)
+                    artifact_zip.extractall("gluon/output/")
+                    os.rename("gluon/output", version)
+                else:
+                    print(f"'{version}' already exists")
+                    sys.exit(1)
-- 
GitLab