feat: accept arguments through ssh command arguments
Some checks failed
Go Project Action / Spell-check and test go project (push) Failing after 54s
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user