1
0
mirror of https://github.com/rancher/os.git synced 2025-08-02 07:24:28 +00:00

remove default directory from tls generate cmd

This commit is contained in:
wlan0 2015-04-29 04:38:43 -07:00
parent 47f7ac22db
commit dcc89dfbc6

View File

@ -1,6 +1,7 @@
package control
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
@ -36,7 +37,7 @@ func tlsConfCommands() []cli.Command {
cli.StringFlag{
Name: "dir, d",
Usage: "the directory to save/read the certs to/from",
Value: "${HOME}/.docker",
Value: "",
},
},
},
@ -132,7 +133,10 @@ func generate(c *cli.Context) error {
}
generateServer := c.Bool("server")
outDir := os.ExpandEnv(c.String("dir"))
outDir := c.String("dir")
if outDir == "" {
return fmt.Errorf("out directory (-d, --dir) not specified")
}
caCertPath := filepath.Join(outDir, "ca.pem")
caKeyPath := filepath.Join(outDir, "ca-key.pem")
certPath := filepath.Join(outDir, "cert.pem")