mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-08 21:49:52 +00:00
Fix the issue with SSH deployment failing to upload the certificate.
This commit is contained in:
parent
2549f61028
commit
993b34eca6
@ -99,7 +99,7 @@ func (s *ssh) upload(client *sshPkg.Client, content, path string) error {
|
|||||||
}
|
}
|
||||||
defer sftpCli.Close()
|
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)
|
return fmt.Errorf("failed to create remote directory: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
internal/deployer/ssh_test.go
Normal file
12
internal/deployer/ssh_test.go
Normal 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)
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user