Commit 163a540d authored by Mo Firouz's avatar Mo Firouz
Browse files

Fix regression loading config file. #48

parent 1d7e6200
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -7,6 +7,9 @@ The format is based on [keep a changelog](http://keepachangelog.com/) and this p
### Changed
- The build system now strips up to current dir in recorded source file paths at compile.

### Fixed
- Fix regression loading config file.

## [0.11.3] - 2017-02-25
### Added
- Add CORS headers for browser games.
+12 −11
Original line number Diff line number Diff line
@@ -156,21 +156,22 @@ func parseArgs(clogger zap.Logger) server.Config {
	var opsPort int
	flags.IntVar(&opsPort, "ops-port", -1, "Set port for ops dashboard.")

	if err := flags.Parse(os.Args[1:]); err != nil {
		clogger.Error("Could not parse command line arguments - ignoring command-line overrides", zap.Error(err))
	} else {

		if len(filepath) > 0 {
			data, err := ioutil.ReadFile(filepath)
			if err != nil {
				clogger.Error("Could not read config file, using defaults", zap.Error(err))
			} else {
			err = yaml.Unmarshal([]byte(data), config)
				err = yaml.Unmarshal(data, config)
				if err != nil {
					clogger.Error("Could not parse config file, using defaults", zap.Error(err))
				}
			}
		}

	if err := flags.Parse(os.Args[1:]); err != nil {
		clogger.Error("Could not parse command line arguments - ignoring command-line overrides", zap.Error(err))
	} else {
		if len(name) > 0 {
			config.Name = name
		}