aerogear / charmil

The framework for building modular plugin based CLI's using Cobra and Golang
https://aerogear.github.io/charmil
Apache License 2.0
116 stars 13 forks source link

feat: add command in charmil cli #207

Closed ankithans closed 3 years ago

ankithans commented 3 years ago

Closes #166

Description

Type of change

Checklist

image

wtrocki commented 3 years ago

Very nice!

namit-chandwani commented 3 years ago

The add command fails when any of the parent directories in --cmdPath flag doesn't exist.

Logs:

>> ./charmil add --cmdName="mycmd" --cmdPath="./cmd"

Usage:
  charmil add [flags]

Examples:
$ charmil add cliname

Flags:
  -s, --cmdName string   name of the new command
  -c, --cmdPath string   command path where you want to create the command (default ".")
  -h, --help             help for add

mkdir cmd/mycmd: no such file or directory

I had a similar issue with the crud command. Mentioning the PR which fixed it (for reference): https://github.com/aerogear/charmil/pull/192

Just replacing os.Mkdir with os.MkdirAll (while creating the dir) should be able to fix this mostly.

ankithans commented 3 years ago

should we merge this @wtrocki ?

wtrocki commented 3 years ago

Ok.. Rush doesn't help. Release needed.