Skip to content

Commit

Permalink
Added 'description' attribute for qrepo.json
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Jan 21, 2024
1 parent f965ce4 commit 868a83f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions core/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ func InitRepo() {
projectAuthor = tmpAuthor
}

fmt.Print("Description: ")
projectDesc := util.ReadString()

gitOrigin, err := util.GetGitRemoteOrigin()
if err != nil || gitOrigin == "" {
gitOrigin = "null"
Expand All @@ -55,6 +58,7 @@ func InitRepo() {

generated := "{\n\t\"name\": \"" + projectName + "\"," +
"\n\t\"author\": \"" + projectAuthor + "\"," +
"\n\t\"description\": \"" + projectDesc + "\"," +
"\n\t\"git\": \"" + gitOrigin + "\"," +
"\n\t\"scripts\": {\n\t\t\"test\": [\"echo No test specified.\"]\n\t}" +
"\n}"
Expand Down Expand Up @@ -124,6 +128,7 @@ func LogRepo() {

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[35mGit\033[0m:\t\t" + qrepo.Git)
fmt.Println("\033[35mScripts\033[0m:\t" + strings.Join(qrepo.getMapKeys(), ", "))
}
9 changes: 5 additions & 4 deletions core/qrepo.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import (
)

type Qrepo struct {
Name string `json:"name"`
Author string `json:"author"`
Git string `json:"git"`
Scripts map[string][]string `json:"scripts"`
Name string `json:"name"`
Author string `json:"author"`
Description string `json:"description"`
Git string `json:"git"`
Scripts map[string][]string `json:"scripts"`
}

func readCurrentQrepo() ([]byte, error) {
Expand Down

0 comments on commit 868a83f

Please sign in to comment.