mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-22 16:48:23 +01:00
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.
This commit is contained in:
parent
5dfb8a816f
commit
4e5eea51b6
@ -74,14 +74,7 @@ const PrintPingPacket = `printf "\n##N{\"type\": \"ping\"}\n"`
|
|||||||
|
|
||||||
const MShellServerCommandFmt = `
|
const MShellServerCommandFmt = `
|
||||||
PATH=$PATH:~/.mshell;
|
PATH=$PATH:~/.mshell;
|
||||||
which mshell-[%VERSION%] > /dev/null;
|
mshell-[%VERSION%] --server 2> /dev/null || printf "\n##N{\"type\": \"init\", \"notfound\": true, \"uname\": \"%s | %s\"}\n" "$(uname -s)" "$(uname -m)"
|
||||||
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
|
|
||||||
`
|
`
|
||||||
|
|
||||||
func MakeLocalMShellCommandStr(isSudo bool) (string, error) {
|
func MakeLocalMShellCommandStr(isSudo bool) (string, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user