Don't try to truncate a file that doesn't actually exist yet
This commit is contained in:
parent
29217bf0cc
commit
56be65888c
|
@ -167,9 +167,12 @@ 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
|
||||||
if err := os.Truncate(c.LogPath, 0); err != nil {
|
// to truncate them.
|
||||||
return err
|
if _, err := os.Stat(c.LogPath); err == nil {
|
||||||
|
if err := os.Truncate(c.LogPath, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset the permissions on files for the server before actually trying
|
// Reset the permissions on files for the server before actually trying
|
||||||
|
|
Loading…
Reference in New Issue
Block a user