From 4e5eea51b65318428f83a16133b7cc3df53832bd Mon Sep 17 00:00:00 2001 From: Sylvia Crowe Date: Fri, 1 Mar 2024 00:44:18 -0800 Subject: [PATCH] chore: simplify command to run waveshell remotely This change removes the extra check for a directory and just tries to run the command instead. It pipes the usual error to null and prints an init packet instead. --- wavesrv/pkg/remote/remote.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/wavesrv/pkg/remote/remote.go b/wavesrv/pkg/remote/remote.go index 987e270ab..e6e82bac6 100644 --- a/wavesrv/pkg/remote/remote.go +++ b/wavesrv/pkg/remote/remote.go @@ -74,14 +74,7 @@ const PrintPingPacket = `printf "\n##N{\"type\": \"ping\"}\n"` const MShellServerCommandFmt = ` PATH=$PATH:~/.mshell; -which mshell-[%VERSION%] > /dev/null; -if [[ "$?" -ne 0 ]] -then - printf "\n##N{\"type\": \"init\", \"notfound\": true, \"uname\": \"%s | %s\"}\n" "$(uname -s)" "$(uname -m)" -else - [%PINGPACKET%] - mshell-[%VERSION%] --server -fi +mshell-[%VERSION%] --server 2> /dev/null || printf "\n##N{\"type\": \"init\", \"notfound\": true, \"uname\": \"%s | %s\"}\n" "$(uname -s)" "$(uname -m)" ` func MakeLocalMShellCommandStr(isSudo bool) (string, error) {