Add api command

This commit is contained in:
世界
2026-08-30 17:41:45 +08:00
parent fcee5656b9
commit bd059fc8aa
51 changed files with 5413 additions and 4 deletions
@@ -0,0 +1,20 @@
package main
import (
"errors"
"os"
"os/exec"
)
func executeSSH(path string, argv []string) error {
command := exec.Command(path, argv[1:]...)
command.Stdin = os.Stdin
command.Stdout = os.Stdout
command.Stderr = os.Stderr
err := command.Run()
var exitError *exec.ExitError
if errors.As(err, &exitError) {
os.Exit(exitError.ExitCode())
}
return err
}