{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/source-to-image/pulls/comments/30078662","id":30078662,"diff_hunk":"@@ -66,8 +66,15 @@ func ConvertEnvironment(env []Environment) (result []string) {\n \n // ConvertEnvironmentToDocker converts the []Environment into Dockerfile format\n func ConvertEnvironmentToDocker(env []Environment) (result string) {\n+\tfirst := true\n \tfor _, e := range env {\n-\t\tresult += fmt.Sprintf(\"ENV %s %s\\n\", e.Name, e.Value)\n+\t\tif first {\n+\t\t\tresult += fmt.Sprintf(\"ENV %s=\\\"%s\\\"\", e.Name, e.Value)\n+\t\t\tfirst = false\n+\t\t} else {\n+\t\t\tresult += fmt.Sprintf(\" \\\\\\n\\t%s=\\\"%s\\\"\", e.Name, e.Value)\n+\t\t}\n \t}","path":"pkg/scripts/environment.go","position":13,"original_position":13,"commit_id":"92f8e7438f7c8143a8070caa8e912cecd374f3f2","original_commit_id":"92f8e7438f7c8143a8070caa8e912cecd374f3f2","user":{"login":"soltysh","id":576341,"avatar_url":"https://avatars.githubusercontent.com/u/576341?v=3","gravatar_id":"","url":"https://api.github.com/users/soltysh","html_url":"https://github.com/soltysh","followers_url":"https://api.github.com/users/soltysh/followers","following_url":"https://api.github.com/users/soltysh/following{/other_user}","gists_url":"https://api.github.com/users/soltysh/gists{/gist_id}","starred_url":"https://api.github.com/users/soltysh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soltysh/subscriptions","organizations_url":"https://api.github.com/users/soltysh/orgs","repos_url":"https://api.github.com/users/soltysh/repos","events_url":"https://api.github.com/users/soltysh/events{/privacy}","received_events_url":"https://api.github.com/users/soltysh/received_events","type":"User","site_admin":false},"body":"Besides to avoid that if inside the loop, you could create first the `ENV` line and then do `for _, e := range env[1:]` (don't forget to check the length of `env` before doing that :wink: )","created_at":"2015-05-11T20:33:53Z","updated_at":"2015-05-11T20:33:53Z","html_url":"https://github.com/openshift/source-to-image/pull/182#discussion_r30078662","pull_request_url":"https://api.github.com/repos/openshift/source-to-image/pulls/182","_links":{"self":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/comments/30078662"},"html":{"href":"https://github.com/openshift/source-to-image/pull/182#discussion_r30078662"},"pull_request":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/182"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/source-to-image/pulls/182","id":35165089,"html_url":"https://github.com/openshift/source-to-image/pull/182","diff_url":"https://github.com/openshift/source-to-image/pull/182.diff","patch_url":"https://github.com/openshift/source-to-image/pull/182.patch","issue_url":"https://api.github.com/repos/openshift/source-to-image/issues/182","number":182,"state":"open","locked":false,"title":"merge env variables when adding them","user":{"login":"bparees","id":4974046,"avatar_url":"https://avatars.githubusercontent.com/u/4974046?v=3","gravatar_id":"","url":"https://api.github.com/users/bparees","html_url":"https://github.com/bparees","followers_url":"https://api.github.com/users/bparees/followers","following_url":"https://api.github.com/users/bparees/following{/other_user}","gists_url":"https://api.github.com/users/bparees/gists{/gist_id}","starred_url":"https://api.github.com/users/bparees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bparees/subscriptions","organizations_url":"https://api.github.com/users/bparees/orgs","repos_url":"https://api.github.com/users/bparees/repos","events_url":"https://api.github.com/users/bparees/events{/privacy}","received_events_url":"https://api.github.com/users/bparees/received_events","type":"User","site_admin":false},"body":null,"created_at":"2015-05-11T20:20:33Z","updated_at":"2015-05-11T20:33:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"18dfad74a0ee408ced0e3023f2d9ea731d14b99b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openshift/source-to-image/pulls/182/commits","review_comments_url":"https://api.github.com/repos/openshift/source-to-image/pulls/182/comments","review_comment_url":"https://api.github.com/repos/openshift/source-to-image/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/source-to-image/issues/182/comments","statuses_url":"https://api.github.com/repos/openshift/source-to-image/statuses/92f8e7438f7c8143a8070caa8e912cecd374f3f2","head":{"label":"bparees:merge_env","ref":"merge_env","sha":"92f8e7438f7c8143a8070caa8e912cecd374f3f2","user":{"login":"bparees","id":4974046,"avatar_url":"https://avatars.githubusercontent.com/u/4974046?v=3","gravatar_id":"","url":"https://api.github.com/users/bparees","html_url":"https://github.com/bparees","followers_url":"https://api.github.com/users/bparees/followers","following_url":"https://api.github.com/users/bparees/following{/other_user}","gists_url":"https://api.github.com/users/bparees/gists{/gist_id}","starred_url":"https://api.github.com/users/bparees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bparees/subscriptions","organizations_url":"https://api.github.com/users/bparees/orgs","repos_url":"https://api.github.com/users/bparees/repos","events_url":"https://api.github.com/users/bparees/events{/privacy}","received_events_url":"https://api.github.com/users/bparees/received_events","type":"User","site_admin":false},"repo":{"id":26235612,"name":"source-to-image","full_name":"bparees/source-to-image","owner":{"login":"bparees","id":4974046,"avatar_url":"https://avatars.githubusercontent.com/u/4974046?v=3","gravatar_id":"","url":"https://api.github.com/users/bparees","html_url":"https://github.com/bparees","followers_url":"https://api.github.com/users/bparees/followers","following_url":"https://api.github.com/users/bparees/following{/other_user}","gists_url":"https://api.github.com/users/bparees/gists{/gist_id}","starred_url":"https://api.github.com/users/bparees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bparees/subscriptions","organizations_url":"https://api.github.com/users/bparees/orgs","repos_url":"https://api.github.com/users/bparees/repos","events_url":"https://api.github.com/users/bparees/events{/privacy}","received_events_url":"https://api.github.com/users/bparees/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bparees/source-to-image","description":"A tool for building/building artifacts from source and injecting into docker images","fork":true,"url":"https://api.github.com/repos/bparees/source-to-image","forks_url":"https://api.github.com/repos/bparees/source-to-image/forks","keys_url":"https://api.github.com/repos/bparees/source-to-image/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bparees/source-to-image/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bparees/source-to-image/teams","hooks_url":"https://api.github.com/repos/bparees/source-to-image/hooks","issue_events_url":"https://api.github.com/repos/bparees/source-to-image/issues/events{/number}","events_url":"https://api.github.com/repos/bparees/source-to-image/events","assignees_url":"https://api.github.com/repos/bparees/source-to-image/assignees{/user}","branches_url":"https://api.github.com/repos/bparees/source-to-image/branches{/branch}","tags_url":"https://api.github.com/repos/bparees/source-to-image/tags","blobs_url":"https://api.github.com/repos/bparees/source-to-image/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bparees/source-to-image/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bparees/source-to-image/git/refs{/sha}","trees_url":"https://api.github.com/repos/bparees/source-to-image/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bparees/source-to-image/statuses/{sha}","languages_url":"https://api.github.com/repos/bparees/source-to-image/languages","stargazers_url":"https://api.github.com/repos/bparees/source-to-image/stargazers","contributors_url":"https://api.github.com/repos/bparees/source-to-image/contributors","subscribers_url":"https://api.github.com/repos/bparees/source-to-image/subscribers","subscription_url":"https://api.github.com/repos/bparees/source-to-image/subscription","commits_url":"https://api.github.com/repos/bparees/source-to-image/commits{/sha}","git_commits_url":"https://api.github.com/repos/bparees/source-to-image/git/commits{/sha}","comments_url":"https://api.github.com/repos/bparees/source-to-image/comments{/number}","issue_comment_url":"https://api.github.com/repos/bparees/source-to-image/issues/comments{/number}","contents_url":"https://api.github.com/repos/bparees/source-to-image/contents/{+path}","compare_url":"https://api.github.com/repos/bparees/source-to-image/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bparees/source-to-image/merges","archive_url":"https://api.github.com/repos/bparees/source-to-image/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bparees/source-to-image/downloads","issues_url":"https://api.github.com/repos/bparees/source-to-image/issues{/number}","pulls_url":"https://api.github.com/repos/bparees/source-to-image/pulls{/number}","milestones_url":"https://api.github.com/repos/bparees/source-to-image/milestones{/number}","notifications_url":"https://api.github.com/repos/bparees/source-to-image/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bparees/source-to-image/labels{/name}","releases_url":"https://api.github.com/repos/bparees/source-to-image/releases{/id}","created_at":"2014-11-05T19:23:26Z","updated_at":"2015-05-06T17:48:07Z","pushed_at":"2015-05-11T20:23:56Z","git_url":"git://github.com/bparees/source-to-image.git","ssh_url":"git@github.com:bparees/source-to-image.git","clone_url":"https://github.com/bparees/source-to-image.git","svn_url":"https://github.com/bparees/source-to-image","homepage":"","size":939,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openshift:master","ref":"master","sha":"cac7fb980bd399a1c914aabed2cc28dd19d70901","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":16323162,"name":"source-to-image","full_name":"openshift/source-to-image","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/source-to-image","description":"A tool for building/building artifacts from source and injecting into docker images","fork":false,"url":"https://api.github.com/repos/openshift/source-to-image","forks_url":"https://api.github.com/repos/openshift/source-to-image/forks","keys_url":"https://api.github.com/repos/openshift/source-to-image/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/source-to-image/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/source-to-image/teams","hooks_url":"https://api.github.com/repos/openshift/source-to-image/hooks","issue_events_url":"https://api.github.com/repos/openshift/source-to-image/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/source-to-image/events","assignees_url":"https://api.github.com/repos/openshift/source-to-image/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/source-to-image/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/source-to-image/tags","blobs_url":"https://api.github.com/repos/openshift/source-to-image/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/source-to-image/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/source-to-image/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/source-to-image/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/source-to-image/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/source-to-image/languages","stargazers_url":"https://api.github.com/repos/openshift/source-to-image/stargazers","contributors_url":"https://api.github.com/repos/openshift/source-to-image/contributors","subscribers_url":"https://api.github.com/repos/openshift/source-to-image/subscribers","subscription_url":"https://api.github.com/repos/openshift/source-to-image/subscription","commits_url":"https://api.github.com/repos/openshift/source-to-image/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/source-to-image/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/source-to-image/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/source-to-image/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/source-to-image/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/source-to-image/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/source-to-image/merges","archive_url":"https://api.github.com/repos/openshift/source-to-image/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/source-to-image/downloads","issues_url":"https://api.github.com/repos/openshift/source-to-image/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/source-to-image/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/source-to-image/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/source-to-image/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/source-to-image/labels{/name}","releases_url":"https://api.github.com/repos/openshift/source-to-image/releases{/id}","created_at":"2014-01-28T19:32:40Z","updated_at":"2015-05-06T17:41:30Z","pushed_at":"2015-05-11T20:23:56Z","git_url":"git://github.com/openshift/source-to-image.git","ssh_url":"git@github.com:openshift/source-to-image.git","clone_url":"https://github.com/openshift/source-to-image.git","svn_url":"https://github.com/openshift/source-to-image","homepage":"","size":2431,"stargazers_count":81,"watchers_count":81,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":36,"mirror_url":null,"open_issues_count":20,"forks":36,"open_issues":20,"watchers":81,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/182"},"html":{"href":"https://github.com/openshift/source-to-image/pull/182"},"issue":{"href":"https://api.github.com/repos/openshift/source-to-image/issues/182"},"comments":{"href":"https://api.github.com/repos/openshift/source-to-image/issues/182/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/182/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/source-to-image/pulls/182/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/source-to-image/statuses/92f8e7438f7c8143a8070caa8e912cecd374f3f2"}}}}