Skip to content

Commit

Permalink
Fixed 'description' attribute bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Jan 21, 2024
1 parent 868a83f commit aea7d45
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions core/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ func LogRepo() {

qrepo, err := extractQrepoInfos()
if err != nil {
fmt.Println("Error: " + err.Error())
fmt.Println("\033[31mError\033[0m: " + err.Error())
return
}

fmt.Println("\033[35mName\033[0m:\t\t" + qrepo.Name)
fmt.Println("\033[35mAuthor\033[0m:\t\t" + qrepo.Author)
fmt.Println("\033[35mDescription\033[0m:\t\t" + qrepo.Description)
fmt.Println("\033[35mDescription\033[0m:\t" + qrepo.Description)
fmt.Println("\033[35mGit\033[0m:\t\t" + qrepo.Git)
fmt.Println("\033[35mScripts\033[0m:\t" + strings.Join(qrepo.getMapKeys(), ", "))
}
12 changes: 9 additions & 3 deletions util/io.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
package util

import (
"bufio"
"fmt"
"os"
)

func ReadString() string {
ln := ""
fmt.Scanf("%s", &ln)
scanner := bufio.NewScanner(os.Stdin)
scanner.Scan()

return ln
if err := scanner.Err(); err != nil {
fmt.Println("\033[31mError\033[0m: " + err.Error())
os.Exit(0)
}

return scanner.Text()
}

func WriteStringToFile(filename, content string) error {
Expand Down

0 comments on commit aea7d45

Please sign in to comment.