From 1650d05fc90333c53fb8a3a3bfcf7e2cdd1a8bd6 Mon Sep 17 00:00:00 2001 From: Matteo Suppo Date: Fri, 27 Jul 2018 12:01:29 +0200 Subject: [PATCH 1/2] Add ignored flags for compatibility When an old version autoupdates, it often sends -gc and -regex as commandline, while they should be parsed from the ini file. This way the autoupdate will still work. In a later release we'll remove them. --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index d091d519a..be0120c08 100755 --- a/main.go +++ b/main.go @@ -41,6 +41,10 @@ var ( genCert = flag.Bool("generateCert", false, "") additionalConfig = flag.String("additional-config", "config.ini", "config file path") isLaunchSelf = flag.Bool("ls", false, "launch self 5 seconds later") + + // Ignored flags for compatibility + _ = flag.String("gc", "std", "Deprecated. Use the config.ini file") + _ = flag.String("regex", "usb|acm|com", "Deprecated. Use the config.ini file") ) // iniflags From 8e91a131f77cc75beb55e291c5e98d1745ef3bc9 Mon Sep 17 00:00:00 2001 From: Matteo Suppo Date: Fri, 27 Jul 2018 12:47:44 +0200 Subject: [PATCH 2/2] Parse config files relative to the binary --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index be0120c08..12c118c92 100755 --- a/main.go +++ b/main.go @@ -121,7 +121,7 @@ func main() { } // Parse ini config - args, err := parseIni("config.ini") + args, err := parseIni(filepath.Join(dest, "config.ini")) if err != nil { panic(err) } @@ -131,7 +131,7 @@ func main() { } // Parse additional ini config - args, err = parseIni(*additionalConfig) + args, err = parseIni(filepath.Join(dest, *additionalConfig)) if err != nil { panic(err) }