Skip to content

Commit 5677f51

Browse files
Akash-Patilmohammed786
authored andcommitted
Updated Input conditions for add commands (#39)
1 parent 860a578 commit 5677f51

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ vendor/
1717
tmp/
1818
/bin
1919
/script/build
20+
.history/
2021

2122
## Documentation
2223
manual/

cmd/add/hooks/hooks.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ func input() bool {
8282
return false
8383
}
8484
Event = event[eventOption]
85-
85+
if Event == "" {
86+
fmt.Println("Invalid Choice of Event")
87+
return false
88+
}
8689
fmt.Printf("Enter TargetUrl: ")
8790
fmt.Scanf("%s\n", &TargetUrl)
8891
if TargetUrl == "" {

cmd/add/site/site.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ func input() bool {
105105
return false
106106
}
107107
PlanName = plan[planOption]
108+
if PlanName == "" {
109+
fmt.Println("Invalid Choice of Plan")
110+
return false
111+
}
108112
return true
109113

110114
}

0 commit comments

Comments
 (0)