Attempted fix for portable mode
This commit is contained in:
parent
46dbf2d64f
commit
5121438ffc
@ -282,8 +282,15 @@ func (dl *Download) Begin() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dl.Log = append(dl.Log, fmt.Sprintf("executing: %s with args: %s", dl.DownloadProfile.Command, strings.Join(cmdSlice, " ")))
|
dl.Log = append(dl.Log, fmt.Sprintf("executing: %s with args: %s", dl.DownloadProfile.Command, strings.Join(cmdSlice, " ")))
|
||||||
cmd := exec.Command(dl.DownloadProfile.Command, cmdSlice...)
|
|
||||||
|
execAbsolutePath, err := filepath.Abs(dl.DownloadProfile.Command)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd := exec.Command(execAbsolutePath, cmdSlice...)
|
||||||
cmd.Dir = dl.Config.Server.DownloadPath
|
cmd.Dir = dl.Config.Server.DownloadPath
|
||||||
|
log.Printf("Executing command: %v (executable: %s) in %s", cmd, execAbsolutePath, dl.Config.Server.DownloadPath)
|
||||||
|
|
||||||
stdout, err := cmd.StdoutPipe()
|
stdout, err := cmd.StdoutPipe()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -307,9 +314,10 @@ func (dl *Download) Begin() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("Executing command: %v", cmd)
|
|
||||||
err = cmd.Start()
|
err = cmd.Start()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Printf("Executing command failed: %s", err.Error())
|
||||||
|
|
||||||
dl.State = STATE_FAILED
|
dl.State = STATE_FAILED
|
||||||
dl.Finished = true
|
dl.Finished = true
|
||||||
dl.FinishedTS = time.Now()
|
dl.FinishedTS = time.Now()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user