From 44557518e4c71a58e7e73e3a5aed6d17e80f5228 Mon Sep 17 00:00:00 2001 From: John O'Hara Date: Tue, 9 Jul 2024 19:39:18 +0100 Subject: [PATCH] configure script for MacOS local mode: Fixes #221 --- src/main/java/io/hyperfoil/tools/qdup/Host.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/hyperfoil/tools/qdup/Host.java b/src/main/java/io/hyperfoil/tools/qdup/Host.java index eb2a05ad..ff0fc072 100644 --- a/src/main/java/io/hyperfoil/tools/qdup/Host.java +++ b/src/main/java/io/hyperfoil/tools/qdup/Host.java @@ -49,6 +49,7 @@ public class Host { //worked on old fedora but not on fedora 39 //public static final List LOCAL_LINUX_CONNECT_SHELL = Arrays.asList("script", "-q", "/dev/null","/bin/bash"); public static final List LOCAL_LINUX_CONNECT_SHELL = Arrays.asList("script", "-q","-c","/bin/bash","/dev/null"); + public static final List LOCAL_MACOS_CONNECT_SHELL = Arrays.asList("script", "-q", "/dev/null", "/bin/bash"); //LOCAL_EXEC uses System.getRuntime().exec(...) public static final List LOCAL_LINUX_UPLOAD = Arrays.asList("cp","-r","${{source}}","${{destination}}"); public static final List LOCAL_LINUX_DOWNLOAD = Arrays.asList("cp","-r","${{source}}","${{destination}}"); @@ -284,7 +285,11 @@ public Host(String userName,String hostName,String password,int port,String prom this.startContainer=Collections.EMPTY_LIST; this.startConnectedContainer=Collections.EMPTY_LIST; this.stopContainer=Collections.EMPTY_LIST; - this.connectShell= LOCAL_LINUX_CONNECT_SHELL; + if (System.getProperty("os.name").toUpperCase().contains("MAC")) { + this.connectShell = LOCAL_MACOS_CONNECT_SHELL; + } else { + this.connectShell = LOCAL_LINUX_CONNECT_SHELL; + } this.removeContainer=Collections.EMPTY_LIST; this.exec=Collections.EMPTY_LIST;//uses system.getRuntime().exec() }else{//ssh, remember when that was the only use case?