From 98e5a4b22efb9f5ce52975bcd5a6632e740031be Mon Sep 17 00:00:00 2001
From: Philipp Stadler <hello@phstadler.com>
Date: Thu, 18 Jul 2024 17:09:54 +0200
Subject: [PATCH] fixx: patch mudslide for non-interactive use

---
 .gitlab-ci.yml        | 5 ++---
 pack-build/Dockerfile | 8 ++++++++
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 238e1df..96c25f2 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,4 +1,4 @@
-image: durcheinander/pack-build:1.0.0
+image: durcheinander/pack-build:1.0.1
 
 stages:
 - build
@@ -154,6 +154,5 @@ send-release-notes-to-group:
       - mudslide_cache
   script:
     - mkdir -p mudslide_cache
-    # || true is necessary because it fails on non-tty, logging in still works though
-    - mudslide login || true
+    - mudslide login
     - mudslide send $WHATSAPP_RELEASE_NOTIFY_RECIPIENT "$(cat RELEASE_NOTES.md)"
diff --git a/pack-build/Dockerfile b/pack-build/Dockerfile
index 9b6c82a..e024803 100644
--- a/pack-build/Dockerfile
+++ b/pack-build/Dockerfile
@@ -14,3 +14,11 @@ curl
 RUN npm install --global \
 yarn \
 mudslide
+
+# remove the code that waits for a key after login:
+# 137         process.stdin.setRawMode(true);
+# 138         return new Promise(resolve => process.stdin.once('data', () => {
+# 139             process.stdin.setRawMode(false);
+# 140             resolve(undefined);
+# 141         }));
+RUN sed -i '137,141d' /usr/local/lib/node_modules/mudslide/dist/whatsapp.js
-- 
GitLab