{"action":"created","comment":{"url":"https://api.github.com/repos/jdub/packer-resource/pulls/comments/98308049","pull_request_review_id":18950872,"id":98308049,"diff_hunk":"@@ -20,15 +20,25 @@ elif [ ! -f \"$SRC/$TEMPLATE\" ]; then\n   exit 1\n fi\n \n+\n ARGS=\"\"\n-VAR_FILE=$(jq -r '.params.var_file // empty' /tmp/input)\n-if [ ! -f \"$SRC/$VAR_FILE\" ]; then\n-  echo \"var_file $SRC/$VAR_FILE does not exist\" >&2\n-  exit 1\n+VAR_FILE=$(jq '.params.var_file // empty' /tmp/input)\n+\n+if [ $(echo $VAR_FILE | jq 'if type==\"array\" then true else false end') = \"true\" ]; then\n+  FILES=$(echo $VAR_FILE | jq -r '.[]')\n else\n-  ARGS=\"-var-file=$SRC/$VAR_FILE\"\n+  FILES=$(echo $VAR_FILE | jq -r '.')\n fi\n \n+for FILE in $FILES;do\n+  if [ ! -f \"$SRC/$FILE\" ]; then\n+    echo \"var_file $SRC/$FILE does not exist\" >&2\n+    exit 1\n+  else\n+    ARGS=\"${ARGS} -var-file=$SRC/$FILE\"\n+  fi\n+done\n+","path":"bin/out","position":27,"original_position":27,"commit_id":"b156ed901dd4841812ee79a72d5468c2b3a94580","original_commit_id":"b156ed901dd4841812ee79a72d5468c2b3a94580","user":{"login":"jdub","id":276281,"avatar_url":"https://avatars.githubusercontent.com/u/276281?v=3","gravatar_id":"","url":"https://api.github.com/users/jdub","html_url":"https://github.com/jdub","followers_url":"https://api.github.com/users/jdub/followers","following_url":"https://api.github.com/users/jdub/following{/other_user}","gists_url":"https://api.github.com/users/jdub/gists{/gist_id}","starred_url":"https://api.github.com/users/jdub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdub/subscriptions","organizations_url":"https://api.github.com/users/jdub/orgs","repos_url":"https://api.github.com/users/jdub/repos","events_url":"https://api.github.com/users/jdub/events{/privacy}","received_events_url":"https://api.github.com/users/jdub/received_events","type":"User","site_admin":false},"body":"Glad you're checking all of them. 😄 ","created_at":"2017-01-27T23:08:24Z","updated_at":"2017-01-27T23:08:24Z","html_url":"https://github.com/jdub/packer-resource/pull/4#discussion_r98308049","pull_request_url":"https://api.github.com/repos/jdub/packer-resource/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/jdub/packer-resource/pulls/comments/98308049"},"html":{"href":"https://github.com/jdub/packer-resource/pull/4#discussion_r98308049"},"pull_request":{"href":"https://api.github.com/repos/jdub/packer-resource/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/jdub/packer-resource/pulls/4","id":103479513,"html_url":"https://github.com/jdub/packer-resource/pull/4","diff_url":"https://github.com/jdub/packer-resource/pull/4.diff","patch_url":"https://github.com/jdub/packer-resource/pull/4.patch","issue_url":"https://api.github.com/repos/jdub/packer-resource/issues/4","number":4,"state":"open","locked":false,"title":"Allow multiple var_file fix #3","user":{"login":"talset","id":1426698,"avatar_url":"https://avatars.githubusercontent.com/u/1426698?v=3","gravatar_id":"","url":"https://api.github.com/users/talset","html_url":"https://github.com/talset","followers_url":"https://api.github.com/users/talset/followers","following_url":"https://api.github.com/users/talset/following{/other_user}","gists_url":"https://api.github.com/users/talset/gists{/gist_id}","starred_url":"https://api.github.com/users/talset/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talset/subscriptions","organizations_url":"https://api.github.com/users/talset/orgs","repos_url":"https://api.github.com/users/talset/repos","events_url":"https://api.github.com/users/talset/events{/privacy}","received_events_url":"https://api.github.com/users/talset/received_events","type":"User","site_admin":false},"body":"Packer allow to have multiple --var-file. The resource concourse is now\r\nable to handle a list of var_file.\r\n\r\nI am not really familiar with jq, so don't hesitate if you have any suggestions ;)","created_at":"2017-01-27T11:53:50Z","updated_at":"2017-01-27T23:08:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b70d8754ebd3f9caa059b4dd70f439bb832cb4db","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jdub/packer-resource/pulls/4/commits","review_comments_url":"https://api.github.com/repos/jdub/packer-resource/pulls/4/comments","review_comment_url":"https://api.github.com/repos/jdub/packer-resource/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jdub/packer-resource/issues/4/comments","statuses_url":"https://api.github.com/repos/jdub/packer-resource/statuses/b156ed901dd4841812ee79a72d5468c2b3a94580","head":{"label":"talset:multivarfile","ref":"multivarfile","sha":"b156ed901dd4841812ee79a72d5468c2b3a94580","user":{"login":"talset","id":1426698,"avatar_url":"https://avatars.githubusercontent.com/u/1426698?v=3","gravatar_id":"","url":"https://api.github.com/users/talset","html_url":"https://github.com/talset","followers_url":"https://api.github.com/users/talset/followers","following_url":"https://api.github.com/users/talset/following{/other_user}","gists_url":"https://api.github.com/users/talset/gists{/gist_id}","starred_url":"https://api.github.com/users/talset/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talset/subscriptions","organizations_url":"https://api.github.com/users/talset/orgs","repos_url":"https://api.github.com/users/talset/repos","events_url":"https://api.github.com/users/talset/events{/privacy}","received_events_url":"https://api.github.com/users/talset/received_events","type":"User","site_admin":false},"repo":{"id":80124369,"name":"packer-resource","full_name":"talset/packer-resource","owner":{"login":"talset","id":1426698,"avatar_url":"https://avatars.githubusercontent.com/u/1426698?v=3","gravatar_id":"","url":"https://api.github.com/users/talset","html_url":"https://github.com/talset","followers_url":"https://api.github.com/users/talset/followers","following_url":"https://api.github.com/users/talset/following{/other_user}","gists_url":"https://api.github.com/users/talset/gists{/gist_id}","starred_url":"https://api.github.com/users/talset/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talset/subscriptions","organizations_url":"https://api.github.com/users/talset/orgs","repos_url":"https://api.github.com/users/talset/repos","events_url":"https://api.github.com/users/talset/events{/privacy}","received_events_url":"https://api.github.com/users/talset/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/talset/packer-resource","description":"Concourse CI resource to build machine images with Packer","fork":true,"url":"https://api.github.com/repos/talset/packer-resource","forks_url":"https://api.github.com/repos/talset/packer-resource/forks","keys_url":"https://api.github.com/repos/talset/packer-resource/keys{/key_id}","collaborators_url":"https://api.github.com/repos/talset/packer-resource/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/talset/packer-resource/teams","hooks_url":"https://api.github.com/repos/talset/packer-resource/hooks","issue_events_url":"https://api.github.com/repos/talset/packer-resource/issues/events{/number}","events_url":"https://api.github.com/repos/talset/packer-resource/events","assignees_url":"https://api.github.com/repos/talset/packer-resource/assignees{/user}","branches_url":"https://api.github.com/repos/talset/packer-resource/branches{/branch}","tags_url":"https://api.github.com/repos/talset/packer-resource/tags","blobs_url":"https://api.github.com/repos/talset/packer-resource/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/talset/packer-resource/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/talset/packer-resource/git/refs{/sha}","trees_url":"https://api.github.com/repos/talset/packer-resource/git/trees{/sha}","statuses_url":"https://api.github.com/repos/talset/packer-resource/statuses/{sha}","languages_url":"https://api.github.com/repos/talset/packer-resource/languages","stargazers_url":"https://api.github.com/repos/talset/packer-resource/stargazers","contributors_url":"https://api.github.com/repos/talset/packer-resource/contributors","subscribers_url":"https://api.github.com/repos/talset/packer-resource/subscribers","subscription_url":"https://api.github.com/repos/talset/packer-resource/subscription","commits_url":"https://api.github.com/repos/talset/packer-resource/commits{/sha}","git_commits_url":"https://api.github.com/repos/talset/packer-resource/git/commits{/sha}","comments_url":"https://api.github.com/repos/talset/packer-resource/comments{/number}","issue_comment_url":"https://api.github.com/repos/talset/packer-resource/issues/comments{/number}","contents_url":"https://api.github.com/repos/talset/packer-resource/contents/{+path}","compare_url":"https://api.github.com/repos/talset/packer-resource/compare/{base}...{head}","merges_url":"https://api.github.com/repos/talset/packer-resource/merges","archive_url":"https://api.github.com/repos/talset/packer-resource/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/talset/packer-resource/downloads","issues_url":"https://api.github.com/repos/talset/packer-resource/issues{/number}","pulls_url":"https://api.github.com/repos/talset/packer-resource/pulls{/number}","milestones_url":"https://api.github.com/repos/talset/packer-resource/milestones{/number}","notifications_url":"https://api.github.com/repos/talset/packer-resource/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/talset/packer-resource/labels{/name}","releases_url":"https://api.github.com/repos/talset/packer-resource/releases{/id}","deployments_url":"https://api.github.com/repos/talset/packer-resource/deployments","created_at":"2017-01-26T15:00:26Z","updated_at":"2017-01-26T15:00:28Z","pushed_at":"2017-01-27T11:55:37Z","git_url":"git://github.com/talset/packer-resource.git","ssh_url":"git@github.com:talset/packer-resource.git","clone_url":"https://github.com/talset/packer-resource.git","svn_url":"https://github.com/talset/packer-resource","homepage":null,"size":12,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"jdub:master","ref":"master","sha":"9a24bb09edf95ccf989789da97589c85ed217d14","user":{"login":"jdub","id":276281,"avatar_url":"https://avatars.githubusercontent.com/u/276281?v=3","gravatar_id":"","url":"https://api.github.com/users/jdub","html_url":"https://github.com/jdub","followers_url":"https://api.github.com/users/jdub/followers","following_url":"https://api.github.com/users/jdub/following{/other_user}","gists_url":"https://api.github.com/users/jdub/gists{/gist_id}","starred_url":"https://api.github.com/users/jdub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdub/subscriptions","organizations_url":"https://api.github.com/users/jdub/orgs","repos_url":"https://api.github.com/users/jdub/repos","events_url":"https://api.github.com/users/jdub/events{/privacy}","received_events_url":"https://api.github.com/users/jdub/received_events","type":"User","site_admin":false},"repo":{"id":55822323,"name":"packer-resource","full_name":"jdub/packer-resource","owner":{"login":"jdub","id":276281,"avatar_url":"https://avatars.githubusercontent.com/u/276281?v=3","gravatar_id":"","url":"https://api.github.com/users/jdub","html_url":"https://github.com/jdub","followers_url":"https://api.github.com/users/jdub/followers","following_url":"https://api.github.com/users/jdub/following{/other_user}","gists_url":"https://api.github.com/users/jdub/gists{/gist_id}","starred_url":"https://api.github.com/users/jdub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdub/subscriptions","organizations_url":"https://api.github.com/users/jdub/orgs","repos_url":"https://api.github.com/users/jdub/repos","events_url":"https://api.github.com/users/jdub/events{/privacy}","received_events_url":"https://api.github.com/users/jdub/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jdub/packer-resource","description":"Concourse CI resource to build machine images with Packer","fork":false,"url":"https://api.github.com/repos/jdub/packer-resource","forks_url":"https://api.github.com/repos/jdub/packer-resource/forks","keys_url":"https://api.github.com/repos/jdub/packer-resource/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jdub/packer-resource/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jdub/packer-resource/teams","hooks_url":"https://api.github.com/repos/jdub/packer-resource/hooks","issue_events_url":"https://api.github.com/repos/jdub/packer-resource/issues/events{/number}","events_url":"https://api.github.com/repos/jdub/packer-resource/events","assignees_url":"https://api.github.com/repos/jdub/packer-resource/assignees{/user}","branches_url":"https://api.github.com/repos/jdub/packer-resource/branches{/branch}","tags_url":"https://api.github.com/repos/jdub/packer-resource/tags","blobs_url":"https://api.github.com/repos/jdub/packer-resource/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jdub/packer-resource/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jdub/packer-resource/git/refs{/sha}","trees_url":"https://api.github.com/repos/jdub/packer-resource/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jdub/packer-resource/statuses/{sha}","languages_url":"https://api.github.com/repos/jdub/packer-resource/languages","stargazers_url":"https://api.github.com/repos/jdub/packer-resource/stargazers","contributors_url":"https://api.github.com/repos/jdub/packer-resource/contributors","subscribers_url":"https://api.github.com/repos/jdub/packer-resource/subscribers","subscription_url":"https://api.github.com/repos/jdub/packer-resource/subscription","commits_url":"https://api.github.com/repos/jdub/packer-resource/commits{/sha}","git_commits_url":"https://api.github.com/repos/jdub/packer-resource/git/commits{/sha}","comments_url":"https://api.github.com/repos/jdub/packer-resource/comments{/number}","issue_comment_url":"https://api.github.com/repos/jdub/packer-resource/issues/comments{/number}","contents_url":"https://api.github.com/repos/jdub/packer-resource/contents/{+path}","compare_url":"https://api.github.com/repos/jdub/packer-resource/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jdub/packer-resource/merges","archive_url":"https://api.github.com/repos/jdub/packer-resource/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jdub/packer-resource/downloads","issues_url":"https://api.github.com/repos/jdub/packer-resource/issues{/number}","pulls_url":"https://api.github.com/repos/jdub/packer-resource/pulls{/number}","milestones_url":"https://api.github.com/repos/jdub/packer-resource/milestones{/number}","notifications_url":"https://api.github.com/repos/jdub/packer-resource/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jdub/packer-resource/labels{/name}","releases_url":"https://api.github.com/repos/jdub/packer-resource/releases{/id}","deployments_url":"https://api.github.com/repos/jdub/packer-resource/deployments","created_at":"2016-04-09T02:39:36Z","updated_at":"2016-12-23T18:03:44Z","pushed_at":"2017-01-27T11:55:38Z","git_url":"git://github.com/jdub/packer-resource.git","ssh_url":"git@github.com:jdub/packer-resource.git","clone_url":"https://github.com/jdub/packer-resource.git","svn_url":"https://github.com/jdub/packer-resource","homepage":null,"size":12,"stargazers_count":9,"watchers_count":9,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":3,"forks":5,"open_issues":3,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jdub/packer-resource/pulls/4"},"html":{"href":"https://github.com/jdub/packer-resource/pull/4"},"issue":{"href":"https://api.github.com/repos/jdub/packer-resource/issues/4"},"comments":{"href":"https://api.github.com/repos/jdub/packer-resource/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/jdub/packer-resource/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/jdub/packer-resource/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jdub/packer-resource/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/jdub/packer-resource/statuses/b156ed901dd4841812ee79a72d5468c2b3a94580"}}}}
{"actor":{"display_login":"jdub"}}