From 36f3be038516fdad535bd7408d3935ee87489748 Mon Sep 17 00:00:00 2001
From: Mathias Wagner <germannewsmaker@gmail.com>
Date: Fri, 2 Jun 2023 14:29:19 +0200
Subject: [PATCH] Added the replace parameter to the app.js

---
 server/handler/app.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/server/handler/app.js b/server/handler/app.js
index dba51be..a10fde1 100644
--- a/server/handler/app.js
+++ b/server/handler/app.js
@@ -67,6 +67,12 @@ module.exports = (io, socket) => {
                 if (msg?.data[key] !== value) return;
             }
 
+            if (item.replace) {
+                Object.keys(item.replace).map((key) => {
+                    item.command = item.command.replace(new RegExp(`{${key}}`, "g"), item.replace[key]());
+                });
+            }
+
             queue.push({...item, step: index+1});
 
             if (item.description)