{"action":"created","comment":{"url":"https://api.github.com/repos/helm/helm/pulls/comments/60249386","id":60249386,"diff_hunk":"@@ -28,8 +28,12 @@ func GenerateTemplate(out io.Writer, in io.Reader, vals interface{}) {\n }\n \n // Template renders a template to an output file.\n-func Template(out, in, data string) {\n+func Template(out, in, data string, force bool) {\n \tvar dest io.Writer\n+\t_, err := os.Stat(out)\n+\tif !force && err == nil {\n+\t\tlog.Die(\"re-run the command with -f flag\")","path":"action/template.go","position":9,"original_position":9,"commit_id":"dbe5d1f5be6d07f239b63537b5fbbc10da03ecf9","original_commit_id":"dbe5d1f5be6d07f239b63537b5fbbc10da03ecf9","user":{"login":"bacongobbler","id":1360539,"avatar_url":"https://avatars.githubusercontent.com/u/1360539?v=3","gravatar_id":"","url":"https://api.github.com/users/bacongobbler","html_url":"https://github.com/bacongobbler","followers_url":"https://api.github.com/users/bacongobbler/followers","following_url":"https://api.github.com/users/bacongobbler/following{/other_user}","gists_url":"https://api.github.com/users/bacongobbler/gists{/gist_id}","starred_url":"https://api.github.com/users/bacongobbler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bacongobbler/subscriptions","organizations_url":"https://api.github.com/users/bacongobbler/orgs","repos_url":"https://api.github.com/users/bacongobbler/repos","events_url":"https://api.github.com/users/bacongobbler/events{/privacy}","received_events_url":"https://api.github.com/users/bacongobbler/received_events","type":"User","site_admin":false},"body":"Why? We should probably explain more clearly to the user why they need to run with the --force flag.","created_at":"2016-04-19T15:10:05Z","updated_at":"2016-04-19T15:10:05Z","html_url":"https://github.com/helm/helm/pull/435#discussion_r60249386","pull_request_url":"https://api.github.com/repos/helm/helm/pulls/435","_links":{"self":{"href":"https://api.github.com/repos/helm/helm/pulls/comments/60249386"},"html":{"href":"https://github.com/helm/helm/pull/435#discussion_r60249386"},"pull_request":{"href":"https://api.github.com/repos/helm/helm/pulls/435"}}},"pull_request":{"url":"https://api.github.com/repos/helm/helm/pulls/435","id":66940645,"html_url":"https://github.com/helm/helm/pull/435","diff_url":"https://github.com/helm/helm/pull/435.diff","patch_url":"https://github.com/helm/helm/pull/435.patch","issue_url":"https://api.github.com/repos/helm/helm/issues/435","number":435,"state":"open","locked":false,"title":"feat(generate): add force flag to overwrite generated templates","user":{"login":"smothiki","id":7416231,"avatar_url":"https://avatars.githubusercontent.com/u/7416231?v=3","gravatar_id":"","url":"https://api.github.com/users/smothiki","html_url":"https://github.com/smothiki","followers_url":"https://api.github.com/users/smothiki/followers","following_url":"https://api.github.com/users/smothiki/following{/other_user}","gists_url":"https://api.github.com/users/smothiki/gists{/gist_id}","starred_url":"https://api.github.com/users/smothiki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smothiki/subscriptions","organizations_url":"https://api.github.com/users/smothiki/orgs","repos_url":"https://api.github.com/users/smothiki/repos","events_url":"https://api.github.com/users/smothiki/events{/privacy}","received_events_url":"https://api.github.com/users/smothiki/received_events","type":"User","site_admin":false},"body":"The force flag only works for executing  helm template command in the helm generate header and helm template command directly ","created_at":"2016-04-18T23:51:35Z","updated_at":"2016-04-19T15:10:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9b040883ce9dea5ffe347b9dacc4120755fc268f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/helm/helm/pulls/435/commits","review_comments_url":"https://api.github.com/repos/helm/helm/pulls/435/comments","review_comment_url":"https://api.github.com/repos/helm/helm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/helm/helm/issues/435/comments","statuses_url":"https://api.github.com/repos/helm/helm/statuses/dbe5d1f5be6d07f239b63537b5fbbc10da03ecf9","head":{"label":"smothiki:force","ref":"force","sha":"dbe5d1f5be6d07f239b63537b5fbbc10da03ecf9","user":{"login":"smothiki","id":7416231,"avatar_url":"https://avatars.githubusercontent.com/u/7416231?v=3","gravatar_id":"","url":"https://api.github.com/users/smothiki","html_url":"https://github.com/smothiki","followers_url":"https://api.github.com/users/smothiki/followers","following_url":"https://api.github.com/users/smothiki/following{/other_user}","gists_url":"https://api.github.com/users/smothiki/gists{/gist_id}","starred_url":"https://api.github.com/users/smothiki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smothiki/subscriptions","organizations_url":"https://api.github.com/users/smothiki/orgs","repos_url":"https://api.github.com/users/smothiki/repos","events_url":"https://api.github.com/users/smothiki/events{/privacy}","received_events_url":"https://api.github.com/users/smothiki/received_events","type":"User","site_admin":false},"repo":{"id":56530496,"name":"helm","full_name":"smothiki/helm","owner":{"login":"smothiki","id":7416231,"avatar_url":"https://avatars.githubusercontent.com/u/7416231?v=3","gravatar_id":"","url":"https://api.github.com/users/smothiki","html_url":"https://github.com/smothiki","followers_url":"https://api.github.com/users/smothiki/followers","following_url":"https://api.github.com/users/smothiki/following{/other_user}","gists_url":"https://api.github.com/users/smothiki/gists{/gist_id}","starred_url":"https://api.github.com/users/smothiki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smothiki/subscriptions","organizations_url":"https://api.github.com/users/smothiki/orgs","repos_url":"https://api.github.com/users/smothiki/repos","events_url":"https://api.github.com/users/smothiki/events{/privacy}","received_events_url":"https://api.github.com/users/smothiki/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/smothiki/helm","description":"Helm - The Kubernetes Package Manager","fork":true,"url":"https://api.github.com/repos/smothiki/helm","forks_url":"https://api.github.com/repos/smothiki/helm/forks","keys_url":"https://api.github.com/repos/smothiki/helm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smothiki/helm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smothiki/helm/teams","hooks_url":"https://api.github.com/repos/smothiki/helm/hooks","issue_events_url":"https://api.github.com/repos/smothiki/helm/issues/events{/number}","events_url":"https://api.github.com/repos/smothiki/helm/events","assignees_url":"https://api.github.com/repos/smothiki/helm/assignees{/user}","branches_url":"https://api.github.com/repos/smothiki/helm/branches{/branch}","tags_url":"https://api.github.com/repos/smothiki/helm/tags","blobs_url":"https://api.github.com/repos/smothiki/helm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smothiki/helm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smothiki/helm/git/refs{/sha}","trees_url":"https://api.github.com/repos/smothiki/helm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smothiki/helm/statuses/{sha}","languages_url":"https://api.github.com/repos/smothiki/helm/languages","stargazers_url":"https://api.github.com/repos/smothiki/helm/stargazers","contributors_url":"https://api.github.com/repos/smothiki/helm/contributors","subscribers_url":"https://api.github.com/repos/smothiki/helm/subscribers","subscription_url":"https://api.github.com/repos/smothiki/helm/subscription","commits_url":"https://api.github.com/repos/smothiki/helm/commits{/sha}","git_commits_url":"https://api.github.com/repos/smothiki/helm/git/commits{/sha}","comments_url":"https://api.github.com/repos/smothiki/helm/comments{/number}","issue_comment_url":"https://api.github.com/repos/smothiki/helm/issues/comments{/number}","contents_url":"https://api.github.com/repos/smothiki/helm/contents/{+path}","compare_url":"https://api.github.com/repos/smothiki/helm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smothiki/helm/merges","archive_url":"https://api.github.com/repos/smothiki/helm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smothiki/helm/downloads","issues_url":"https://api.github.com/repos/smothiki/helm/issues{/number}","pulls_url":"https://api.github.com/repos/smothiki/helm/pulls{/number}","milestones_url":"https://api.github.com/repos/smothiki/helm/milestones{/number}","notifications_url":"https://api.github.com/repos/smothiki/helm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smothiki/helm/labels{/name}","releases_url":"https://api.github.com/repos/smothiki/helm/releases{/id}","deployments_url":"https://api.github.com/repos/smothiki/helm/deployments","created_at":"2016-04-18T18:09:49Z","updated_at":"2016-04-18T18:09:51Z","pushed_at":"2016-04-18T23:50:21Z","git_url":"git://github.com/smothiki/helm.git","ssh_url":"git@github.com:smothiki/helm.git","clone_url":"https://github.com/smothiki/helm.git","svn_url":"https://github.com/smothiki/helm","homepage":"https://helm.sh","size":1789,"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":"helm:master","ref":"master","sha":"69d21404ab72162a6fe92058092eedaac2a85900","user":{"login":"helm","id":15859888,"avatar_url":"https://avatars.githubusercontent.com/u/15859888?v=3","gravatar_id":"","url":"https://api.github.com/users/helm","html_url":"https://github.com/helm","followers_url":"https://api.github.com/users/helm/followers","following_url":"https://api.github.com/users/helm/following{/other_user}","gists_url":"https://api.github.com/users/helm/gists{/gist_id}","starred_url":"https://api.github.com/users/helm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helm/subscriptions","organizations_url":"https://api.github.com/users/helm/orgs","repos_url":"https://api.github.com/users/helm/repos","events_url":"https://api.github.com/users/helm/events{/privacy}","received_events_url":"https://api.github.com/users/helm/received_events","type":"Organization","site_admin":false},"repo":{"id":44570556,"name":"helm","full_name":"helm/helm","owner":{"login":"helm","id":15859888,"avatar_url":"https://avatars.githubusercontent.com/u/15859888?v=3","gravatar_id":"","url":"https://api.github.com/users/helm","html_url":"https://github.com/helm","followers_url":"https://api.github.com/users/helm/followers","following_url":"https://api.github.com/users/helm/following{/other_user}","gists_url":"https://api.github.com/users/helm/gists{/gist_id}","starred_url":"https://api.github.com/users/helm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helm/subscriptions","organizations_url":"https://api.github.com/users/helm/orgs","repos_url":"https://api.github.com/users/helm/repos","events_url":"https://api.github.com/users/helm/events{/privacy}","received_events_url":"https://api.github.com/users/helm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/helm/helm","description":"Helm - The Kubernetes Package Manager","fork":false,"url":"https://api.github.com/repos/helm/helm","forks_url":"https://api.github.com/repos/helm/helm/forks","keys_url":"https://api.github.com/repos/helm/helm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/helm/helm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/helm/helm/teams","hooks_url":"https://api.github.com/repos/helm/helm/hooks","issue_events_url":"https://api.github.com/repos/helm/helm/issues/events{/number}","events_url":"https://api.github.com/repos/helm/helm/events","assignees_url":"https://api.github.com/repos/helm/helm/assignees{/user}","branches_url":"https://api.github.com/repos/helm/helm/branches{/branch}","tags_url":"https://api.github.com/repos/helm/helm/tags","blobs_url":"https://api.github.com/repos/helm/helm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/helm/helm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/helm/helm/git/refs{/sha}","trees_url":"https://api.github.com/repos/helm/helm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/helm/helm/statuses/{sha}","languages_url":"https://api.github.com/repos/helm/helm/languages","stargazers_url":"https://api.github.com/repos/helm/helm/stargazers","contributors_url":"https://api.github.com/repos/helm/helm/contributors","subscribers_url":"https://api.github.com/repos/helm/helm/subscribers","subscription_url":"https://api.github.com/repos/helm/helm/subscription","commits_url":"https://api.github.com/repos/helm/helm/commits{/sha}","git_commits_url":"https://api.github.com/repos/helm/helm/git/commits{/sha}","comments_url":"https://api.github.com/repos/helm/helm/comments{/number}","issue_comment_url":"https://api.github.com/repos/helm/helm/issues/comments{/number}","contents_url":"https://api.github.com/repos/helm/helm/contents/{+path}","compare_url":"https://api.github.com/repos/helm/helm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/helm/helm/merges","archive_url":"https://api.github.com/repos/helm/helm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/helm/helm/downloads","issues_url":"https://api.github.com/repos/helm/helm/issues{/number}","pulls_url":"https://api.github.com/repos/helm/helm/pulls{/number}","milestones_url":"https://api.github.com/repos/helm/helm/milestones{/number}","notifications_url":"https://api.github.com/repos/helm/helm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/helm/helm/labels{/name}","releases_url":"https://api.github.com/repos/helm/helm/releases{/id}","deployments_url":"https://api.github.com/repos/helm/helm/deployments","created_at":"2015-10-19T23:44:25Z","updated_at":"2016-04-17T19:08:03Z","pushed_at":"2016-04-18T23:51:35Z","git_url":"git://github.com/helm/helm.git","ssh_url":"git@github.com:helm/helm.git","clone_url":"https://github.com/helm/helm.git","svn_url":"https://github.com/helm/helm","homepage":"https://helm.sh","size":1882,"stargazers_count":521,"watchers_count":521,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":44,"mirror_url":null,"open_issues_count":88,"forks":44,"open_issues":88,"watchers":521,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/helm/helm/pulls/435"},"html":{"href":"https://github.com/helm/helm/pull/435"},"issue":{"href":"https://api.github.com/repos/helm/helm/issues/435"},"comments":{"href":"https://api.github.com/repos/helm/helm/issues/435/comments"},"review_comments":{"href":"https://api.github.com/repos/helm/helm/pulls/435/comments"},"review_comment":{"href":"https://api.github.com/repos/helm/helm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/helm/helm/pulls/435/commits"},"statuses":{"href":"https://api.github.com/repos/helm/helm/statuses/dbe5d1f5be6d07f239b63537b5fbbc10da03ecf9"}}}}