Don't try to truncate a file that doesn't actually exist yet
This commit is contained in:
parent
29217bf0cc
commit
56be65888c
|
@ -167,10 +167,13 @@ func (d *DockerEnvironment) Start() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Truncate the log file so we don't end up outputting a bunch of useless log information
|
// Truncate the log file so we don't end up outputting a bunch of useless log information
|
||||||
// to the websocket and whatnot.
|
// to the websocket and whatnot. Check first that the path and file exist before trying
|
||||||
|
// to truncate them.
|
||||||
|
if _, err := os.Stat(c.LogPath); err == nil {
|
||||||
if err := os.Truncate(c.LogPath, 0); err != nil {
|
if err := os.Truncate(c.LogPath, 0); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Reset the permissions on files for the server before actually trying
|
// Reset the permissions on files for the server before actually trying
|
||||||
// to start it.
|
// to start it.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user