File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -239,15 +239,28 @@ func ConfigPush(appID, fileName string) error {
239239 }
240240 }
241241
242- config := strings .Split (string (contents ), "\n " )
243- return ConfigSet (appID , config [:len (config )- 1 ])
242+ file := strings .Split (string (contents ), "\n " )
243+ config := []string {}
244+
245+ for _ , configVar := range file {
246+ if len (configVar ) > 0 {
247+ config = append (config , configVar )
248+ }
249+ }
250+
251+ return ConfigSet (appID , config )
244252}
245253
246254func parseConfig (configVars []string ) map [string ]interface {} {
247255 configMap := make (map [string ]interface {})
248256
249257 regex := regexp .MustCompile (`^([A-z_]+[A-z0-9_]*)=([\s\S]+)$` )
250258 for _ , config := range configVars {
259+ // Skip config that starts with an comment
260+ if config [0 ] == '#' {
261+ continue
262+ }
263+
251264 if regex .MatchString (config ) {
252265 captures := regex .FindStringSubmatch (config )
253266 configMap [captures [1 ]] = captures [2 ]
You can’t perform that action at this time.
0 commit comments