client: always create alloc dir if it is non-empty
This commit is contained in:
parent
0e38f0e914
commit
3d31230ac1
|
@ -131,13 +131,11 @@ func NewClient(cfg *config.Config) (*Client, error) {
|
|||
// init is used to initialize the client and perform any setup
|
||||
// needed before we begin starting its various components.
|
||||
func (c *Client) init() error {
|
||||
if c.config.DevMode {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Ensure the alloc dir exists
|
||||
if err := os.MkdirAll(c.config.AllocDir, 0700); err != nil {
|
||||
return fmt.Errorf("failed creating alloc dir: %s", err)
|
||||
// Ensure the alloc dir exists if we have one
|
||||
if c.config.AllocDir != "" {
|
||||
if err := os.MkdirAll(c.config.AllocDir, 0700); err != nil {
|
||||
return fmt.Errorf("failed creating alloc dir: %s", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue