mirror of
https://github.com/taigrr/mg.git
synced 2026-04-02 03:28:42 -07:00
add support for ignoring comments in config
This commit is contained in:
@@ -51,9 +51,14 @@ func LoadMRConfig() (MRConfig, error) {
|
|||||||
length := -1
|
length := -1
|
||||||
mode := "default"
|
mode := "default"
|
||||||
for n, line := range lines {
|
for n, line := range lines {
|
||||||
|
line = strings.TrimSpace(line)
|
||||||
if line == "" {
|
if line == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
// ignore comments in mrconfig
|
||||||
|
if strings.HasPrefix(line, "#") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if line == "[DEFAULT]" {
|
if line == "[DEFAULT]" {
|
||||||
mode = "default"
|
mode = "default"
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user