Commit 02038d24 authored by Yoanis Gil's avatar Yoanis Gil

Merge branch '56-text-file-is-busy-error-on-cogment-cli-v0-3' into 'master'

Resolve "Text file is busy error on cogment cli v0.3 when running "cogment run""

Closes #56

See merge request !170
parents 77bea089 be562795
Pipeline #131201170 passed with stages
in 15 minutes and 18 seconds
......@@ -86,9 +86,19 @@ func runRunCmd(command string) error {
commandFile, err := ioutil.TempFile("", "cogment-cli-*."+fileExtension)
if err != nil {
log.Fatal(err)
}
if _, err := commandFile.Write([]byte(command)); err != nil {
log.Fatal(err)
}
err = commandFile.Close()
if err != nil {
log.Fatal(err)
}
err = os.Chmod(commandFile.Name(), 0755)
if err != nil {
log.Fatal(err)
......@@ -96,9 +106,6 @@ func runRunCmd(command string) error {
defer os.Remove(commandFile.Name())
if _, err := commandFile.Write([]byte(command)); err != nil {
log.Fatal(err)
}
cmd := exec.Command(shellCommand, args, commandFile.Name())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment