To Build
Warning!!!
in file "config/ReadConfig.go" do this:
// uncomment this code when you build
// ex, err := os.Executable()
// if err != nil {
// panic(err)
// }
// exePath := filepath.Dir(ex)
// jsonFile, err := os.Open(exePath + "/config.json")
// and comment this code when you build
jsonFile, err := os.Open("./config.json")
isso ocorre para que o arquivo compilado consiga reconhecer o arquivo de configurações ao seu lado, e não deixo esse valor como padrão pois gera um bug em desenvolvimento, estou pensando em uma solução para tal.
Build
run:
n
Config Json Options
The configuration file follows these orders:
scheme of what was quoted above:
type config = {
"questions": []question,
"templateCommit": string,
}
type question = {
"id": string,
"type": string,
"label": string,
"options"?: []option,
"min": int,
"max": int,
}
type option = {
"name": string,
"desc": string
}
a full file of configuration for example:
(he works, you can copy and use if you are not in order to create your)
{
"questions": [
{
"id": "scope",
"type": "select",
"label": "What scope of this change? (e.g. backend or frontend)",
"options": [
{ "name": "front-end", "desc": "Change in front-end scope" },
{ "name": "back-end", "desc": "Change in back-end scope" }
]
},
{
"id": "type",
"type": "select",
"label": "Select the type of change you're committing",
"options": [
{ "name": "feat", "desc": "feat: A new feature" },
{ "name": "fix", "desc": "fix: A bug fix" },
{ "name": "docs", "desc": "docs: Documentation only changes" },
{
"name": "style",
"desc": "style: Changes that do not affect the meaning of the code\n (white-space, formatting, missing semi-colons, etc)"
},
{
"name": "refactor",
"desc": "refactor: A code change that neither fixes a bug nor adds a feature"
},
{
"name": "perf",
"desc": "perf: A code change that improves performance"
},
{ "name": "test", "desc": "test: Adding missing tests" },
{
"name": "chore",
"desc": "chore: Changes to the build process or auxiliary tools\n and libraries such as documentation generation"
},
{ "name": "revert", "desc": "revert: Revert to a commit" },
{ "name": "WIP", "desc": "WIP: Work in progress" }
]
},
{
"id": "subject",
"type": "text",
"label": "Write a short, imperative tense description of change (max 66 chars)",
"errorMsg": "Write a minimal 1 and max 66 chars",
"min": 1,
"max": 66
},
{
"id": "desc",
"type": "text",
"label": "Provide a large description of the changes: (press enter for skip)",
"errorMsg": "write a valid text",
"min": 0,
"max": 1000
}
],
"templateCommit": "<type>(<scope>): <subject>\n\n<desc>\n"
}