mirror of https://github.com/usual2970/certimate
Fix the issue with SSH deployment failing to upload the certificate.
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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…
Reference in New Issue