{"action":"opened","issue":{"url":"https://api.github.com/repos/hexya-erp/hexya/issues/2","repository_url":"https://api.github.com/repos/hexya-erp/hexya","labels_url":"https://api.github.com/repos/hexya-erp/hexya/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/hexya-erp/hexya/issues/2/comments","events_url":"https://api.github.com/repos/hexya-erp/hexya/issues/2/events","html_url":"https://github.com/hexya-erp/hexya/issues/2","id":254193969,"number":2,"title":"Config file was not read correctly.","user":{"login":"halybang","id":366701,"avatar_url":"https://avatars3.githubusercontent.com/u/366701?v=4","gravatar_id":"","url":"https://api.github.com/users/halybang","html_url":"https://github.com/halybang","followers_url":"https://api.github.com/users/halybang/followers","following_url":"https://api.github.com/users/halybang/following{/other_user}","gists_url":"https://api.github.com/users/halybang/gists{/gist_id}","starred_url":"https://api.github.com/users/halybang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halybang/subscriptions","organizations_url":"https://api.github.com/users/halybang/orgs","repos_url":"https://api.github.com/users/halybang/repos","events_url":"https://api.github.com/users/halybang/events{/privacy}","received_events_url":"https://api.github.com/users/halybang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-31T02:43:33Z","updated_at":"2017-08-31T02:43:33Z","closed_at":null,"author_association":"NONE","body":"Run `hexya -c config_file_name` not work.\r\nReason: Corbra parses command line args when call Execute() method.\r\nHow to fix:\r\nModify `cmd/hexya.go`\r\n1. In func init(), add `cobra.OnInitialize(initConfig)`\r\n2. Add function\r\n```golang\r\nfunc initConfig() {\r\n\tcfgFile := viper.GetString(\"ConfigFileName\")\r\n\t// Read config either from cfgFile or from home directory!\r\n\tviper.AddConfigPath(\"/etc/hexya/\")\r\n\tviper.AddConfigPath(\"$HOME/.hexya\")\r\n\tviper.AddConfigPath(\".\")\r\n\tif cfgFile == \"\" {\r\n\t\tcfgFile = \"hexya\"\r\n\t}\r\n\tviper.SetConfigFile(cfgFile)\r\n\tviper.ReadInConfig()\r\n}\r\n```"}}
{"actor":{"display_login":"halybang"}}