Skip to content

Commit b37e272

Browse files
authored
Merge pull request #46 from KiraCore/fix/deploy_from_windows
fix: deploy error fix if kensho was runned from windows
2 parents 5aadc89 + 88ebb78 commit b37e272

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

gui/dialog_deploy.go

+9-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"encoding/json"
55
"fmt"
66
"log"
7-
"path/filepath"
87
"strconv"
98
"time"
109

@@ -143,7 +142,15 @@ func showDeployDialog(g *Gui, doneListener binding.DataListener, shidaiInfra bin
143142
}
144143

145144
bootstrapFileUrl := types.BOOTSTRAP_SCRIPT
146-
filePathToSaveOnRemote := filepath.Join("/home/", g.sshClient.User(), "bootstrap.sh")
145+
// filePathToSaveOnRemote := filepath.Join("/home/", g.sshClient.User(), "bootstrap.sh")
146+
var filePathToSaveOnRemote string
147+
bootstrapFileName := "bootstrap.sh"
148+
if g.sshClient.User() == "root" {
149+
filePathToSaveOnRemote = fmt.Sprintf("/%v/%v", g.sshClient.User(), bootstrapFileName)
150+
} else {
151+
filePathToSaveOnRemote = fmt.Sprintf("/home/%v/%v", g.sshClient.User(), bootstrapFileName)
152+
}
153+
147154
log.Println("Bootstrap file save path:", filePathToSaveOnRemote)
148155
f, err := httph.MakeHttpRequest(bootstrapFileUrl, "GET")
149156
if err != nil {

0 commit comments

Comments
 (0)