Skip to content

Commit

Permalink
check if create name is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Pritesh-Patel committed Sep 10, 2019
1 parent afc46a9 commit 986d1e2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/create.go
Expand Up @@ -17,11 +17,13 @@ var createCmd = &cobra.Command{
Use: "create",
Short: "Create new project with provided name.",
Run: func(cmd *cobra.Command, args []string) {
projectName := args[0]
if projectName == "" {
log.Panicf("Project name cannot be empty!")
if len(args) < 1 {
log.Fatalf("Project name cannot be empty!")
}

projectName := args[0]


rootDir := fmt.Sprintf("./%v", projectName)

log.Printf("Creating project %s.", projectName)
Expand Down

0 comments on commit 986d1e2

Please sign in to comment.