diff --git a/clab/file.go b/clab/file.go index a16f032b1..25067e4f6 100644 --- a/clab/file.go +++ b/clab/file.go @@ -134,7 +134,8 @@ func createFile(file, content string) { } } -// CreateDirectory creates a directory +// CreateDirectory creates a directory by a path with a mode/permission specified by perm. +// If directory exists, the function does not do anything. func CreateDirectory(path string, perm os.FileMode) { if _, err := os.Stat(path); os.IsNotExist(err) { os.Mkdir(path, perm) diff --git a/cmd/deploy.go b/cmd/deploy.go index 874435455..e7a62bfd0 100644 --- a/cmd/deploy.go +++ b/cmd/deploy.go @@ -22,8 +22,8 @@ var ipv6Subnet net.IPNet // deployCmd represents the deploy command var deployCmd = &cobra.Command{ - Use: "deploy", - Short: "deploy a lab", + Use: "deploy", + Short: "deploy a lab", Aliases: []string{"dep"}, Run: func(cmd *cobra.Command, args []string) { c := clab.NewContainerLab(debug) @@ -46,7 +46,7 @@ var deployCmd = &cobra.Command{ defer cancel() // create lab directory - log.Info("Creating container lab directory: ", topo) + log.Info("Creating lab directory: ", c.Dir.Lab) clab.CreateDirectory(c.Dir.Lab, 0755) // create root CA