Fix the issue with SSH deployment failing to upload the certificate.

This commit is contained in:
yoan 2024-08-30 11:29:06 +08:00
parent 2549f61028
commit 993b34eca6
2 changed files with 13 additions and 1 deletions

View File

@ -99,7 +99,7 @@ func (s *ssh) upload(client *sshPkg.Client, content, path string) error {
}
defer sftpCli.Close()
if err := sftpCli.MkdirAll(xpath.Base(path)); err != nil {
if err := sftpCli.MkdirAll(xpath.Dir(path)); err != nil {
return fmt.Errorf("failed to create remote directory: %w", err)
}

View File

@ -0,0 +1,12 @@
package deployer
import (
"os"
"path"
"testing"
)
func TestPath(t *testing.T) {
dir := path.Dir("./a/b/c")
os.MkdirAll(dir, 0755)
}