Skip to content

Commit

Permalink
fix:[#153] tasks: remove newline from inputs
Browse files Browse the repository at this point in the history
Co-authored-by: nellfs <pokycelit@gmail.com>
  • Loading branch information
2 people authored and kbdharun committed Oct 21, 2024
1 parent ea43399 commit f537617
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ func newTask(cmd *cobra.Command, args []string) error {
cmdr.Info.Println(vso.Trans("tasks.stacks.new.info.askName"))
reader := bufio.NewReader(os.Stdin)
name, _ = reader.ReadString('\n')
name = strings.TrimSuffix(name, "\n")
if name == "" {
cmdr.Error.Println(vso.Trans("tasks.stacks.new.error.emptyName"))
return nil
Expand All @@ -394,6 +395,7 @@ func newTask(cmd *cobra.Command, args []string) error {
cmdr.Info.Println(vso.Trans("tasks.stacks.new.info.askDescription"))
reader := bufio.NewReader(os.Stdin)
description, _ = reader.ReadString('\n')
description = strings.TrimSuffix(description, "\n")
if description == "" {
cmdr.Error.Println(vso.Trans("tasks.stacks.new.error.emptyDescription"))
return nil
Expand All @@ -409,6 +411,7 @@ func newTask(cmd *cobra.Command, args []string) error {
cmdr.Info.Println(vso.Trans("tasks.stacks.new.info.askCommand"))
reader := bufio.NewReader(os.Stdin)
command, _ = reader.ReadString('\n')
command = strings.TrimSuffix(command, "\n")
if command == "" {
cmdr.Error.Println(vso.Trans("tasks.stacks.new.error.emptyCommand"))
return nil
Expand Down

0 comments on commit f537617

Please sign in to comment.