feat: accept arguments through ssh command arguments
Some checks failed
Go Project Action / Spell-check and test go project (push) Failing after 54s

Configured default arguments are replaced with provided arguments
through the `ssh` command. Without any arguments the default arguments
are used instead.
This commit is contained in:
2025-11-08 12:04:17 +01:00
parent 7dc1f9c53e
commit c6d270fc36
2 changed files with 15 additions and 25 deletions

View File

@@ -55,6 +55,10 @@ func setupSshServer(host string, port string, host_key_path string, users map[st
wish.WithMiddleware(
func(next ssh.Handler) ssh.Handler {
return func(s ssh.Session) {
provided_args := s.Command()
if len(provided_args) > 0 {
args = provided_args
}
cmd := wish.Command(s, name, args...)
if err := cmd.Run(); err != nil {
wish.Fatalln(s, err)