{"action":"created","comment":{"url":"https://api.github.com/repos/resin-io/etcher/pulls/comments/91345159","pull_request_review_id":11854311,"id":91345159,"diff_hunk":"@@ -0,0 +1,82 @@\n+#!/bin/bash\n+\n+###\n+# Copyright 2016 resin.io\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#   http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+###\n+\n+set -u\n+set -e\n+set -x\n+\n+function check_dep() {\n+  if ! command -v $1 2>/dev/null 1>&2; then\n+    echo \"Dependency missing: $1\" 1>&2\n+    exit 1\n+  fi\n+}\n+\n+check_dep wget\n+check_dep md5sum\n+\n+function usage() {\n+  echo \"Usage: $0\"\n+  echo \"\"\n+  echo \"Options\"\n+  echo \"\"\n+  echo \"    -u <url>\"\n+  echo \"    -m <md5 hash>\"\n+  echo \"    -o <output>\"\n+  exit 1\n+}\n+\n+ARGV_URL=\"\"\n+ARGV_MD5_HASH=\"\"\n+ARGV_OUTPUT=\"\"\n+\n+while getopts \":u:m:o:\" option; do\n+  case $option in\n+    u) ARGV_URL=\"$OPTARG\" ;;\n+    m) ARGV_MD5_HASH=\"$OPTARG\" ;;\n+    o) ARGV_OUTPUT=\"$OPTARG\" ;;\n+    *) usage ;;\n+  esac\n+done\n+\n+if [ -z \"$ARGV_URL\" ] || \\\n+   [ -z \"$ARGV_MD5_HASH\" ] || \\\n+   [ -z \"$ARGV_OUTPUT\" ]\n+then\n+  usage\n+fi\n+\n+function md5sum_matches() {\n+  local file=$1\n+  local hash=$2\n+\ttest \"$(md5sum $file | cut -d ' ' -f1)\" = \"$hash\"\n+}\n+\n+if [ -e \"$ARGV_OUTPUT\" ] && md5sum_matches \"$ARGV_OUTPUT\" \"$ARGV_MD5_HASH\"; then\n+  echo \"Re-using from cache\"\n+  exit 0\n+fi\n+\n+wget --no-check-certificate \"$ARGV_URL\" -O \"$ARGV_OUTPUT\"\n+chmod +x \"$ARGV_OUTPUT\"","path":"scripts/unix/download-tool.sh","position":76,"original_position":76,"commit_id":"9c34f7367657b53486f30e72b73a4425a7954374","original_commit_id":"9c34f7367657b53486f30e72b73a4425a7954374","user":{"login":"lurch","id":476186,"avatar_url":"https://avatars.githubusercontent.com/u/476186?v=3","gravatar_id":"","url":"https://api.github.com/users/lurch","html_url":"https://github.com/lurch","followers_url":"https://api.github.com/users/lurch/followers","following_url":"https://api.github.com/users/lurch/following{/other_user}","gists_url":"https://api.github.com/users/lurch/gists{/gist_id}","starred_url":"https://api.github.com/users/lurch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lurch/subscriptions","organizations_url":"https://api.github.com/users/lurch/orgs","repos_url":"https://api.github.com/users/lurch/repos","events_url":"https://api.github.com/users/lurch/events{/privacy}","received_events_url":"https://api.github.com/users/lurch/received_events","type":"User","site_admin":false},"body":"IMHO this `chmod` doesn't belong in this script (since it may well be downloading things that aren't executable), but in the scripts that call this script.","created_at":"2016-12-07T17:38:02Z","updated_at":"2016-12-07T17:38:02Z","html_url":"https://github.com/resin-io/etcher/pull/936#discussion_r91345159","pull_request_url":"https://api.github.com/repos/resin-io/etcher/pulls/936","_links":{"self":{"href":"https://api.github.com/repos/resin-io/etcher/pulls/comments/91345159"},"html":{"href":"https://github.com/resin-io/etcher/pull/936#discussion_r91345159"},"pull_request":{"href":"https://api.github.com/repos/resin-io/etcher/pulls/936"}}},"pull_request":{"url":"https://api.github.com/repos/resin-io/etcher/pulls/936","id":96561642,"html_url":"https://github.com/resin-io/etcher/pull/936","diff_url":"https://github.com/resin-io/etcher/pull/936.diff","patch_url":"https://github.com/resin-io/etcher/pull/936.patch","issue_url":"https://api.github.com/repos/resin-io/etcher/issues/936","number":936,"state":"open","locked":false,"title":"chore: persist temporary artifacts during AppImage builds","user":{"login":"jviotti","id":2192773,"avatar_url":"https://avatars.githubusercontent.com/u/2192773?v=3","gravatar_id":"","url":"https://api.github.com/users/jviotti","html_url":"https://github.com/jviotti","followers_url":"https://api.github.com/users/jviotti/followers","following_url":"https://api.github.com/users/jviotti/following{/other_user}","gists_url":"https://api.github.com/users/jviotti/gists{/gist_id}","starred_url":"https://api.github.com/users/jviotti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jviotti/subscriptions","organizations_url":"https://api.github.com/users/jviotti/orgs","repos_url":"https://api.github.com/users/jviotti/repos","events_url":"https://api.github.com/users/jviotti/events{/privacy}","received_events_url":"https://api.github.com/users/jviotti/received_events","type":"User","site_admin":false},"body":"Currently, `electron-installer-appimage.sh` deletes temporary stuff it\nneeds as it goes (like the AppDir, AppImageAssistant, or even the\nAppImage after creating a ZIP). Since this is not very Make-friendly,\nthe script has been refactored to store everything it needs into its own\ntemporary directory.\n\nSee: https://github.com/resin-io/etcher/pull/913#discussion_r90801230\nSigned-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>","created_at":"2016-12-05T16:28:18Z","updated_at":"2016-12-07T17:38:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"16ce8119154dd6b57c8018ddd116d0f4ed3260b4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/resin-io/etcher/pulls/936/commits","review_comments_url":"https://api.github.com/repos/resin-io/etcher/pulls/936/comments","review_comment_url":"https://api.github.com/repos/resin-io/etcher/pulls/comments{/number}","comments_url":"https://api.github.com/repos/resin-io/etcher/issues/936/comments","statuses_url":"https://api.github.com/repos/resin-io/etcher/statuses/9c34f7367657b53486f30e72b73a4425a7954374","head":{"label":"resin-io:refactor-appimage-script","ref":"refactor-appimage-script","sha":"9c34f7367657b53486f30e72b73a4425a7954374","user":{"login":"resin-io","id":6157842,"avatar_url":"https://avatars.githubusercontent.com/u/6157842?v=3","gravatar_id":"","url":"https://api.github.com/users/resin-io","html_url":"https://github.com/resin-io","followers_url":"https://api.github.com/users/resin-io/followers","following_url":"https://api.github.com/users/resin-io/following{/other_user}","gists_url":"https://api.github.com/users/resin-io/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io/subscriptions","organizations_url":"https://api.github.com/users/resin-io/orgs","repos_url":"https://api.github.com/users/resin-io/repos","events_url":"https://api.github.com/users/resin-io/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io/received_events","type":"Organization","site_admin":false},"repo":{"id":45055693,"name":"etcher","full_name":"resin-io/etcher","owner":{"login":"resin-io","id":6157842,"avatar_url":"https://avatars.githubusercontent.com/u/6157842?v=3","gravatar_id":"","url":"https://api.github.com/users/resin-io","html_url":"https://github.com/resin-io","followers_url":"https://api.github.com/users/resin-io/followers","following_url":"https://api.github.com/users/resin-io/following{/other_user}","gists_url":"https://api.github.com/users/resin-io/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io/subscriptions","organizations_url":"https://api.github.com/users/resin-io/orgs","repos_url":"https://api.github.com/users/resin-io/repos","events_url":"https://api.github.com/users/resin-io/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/resin-io/etcher","description":"Flash OS images to SD cards & USB drives, safely and easily.","fork":false,"url":"https://api.github.com/repos/resin-io/etcher","forks_url":"https://api.github.com/repos/resin-io/etcher/forks","keys_url":"https://api.github.com/repos/resin-io/etcher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/resin-io/etcher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/resin-io/etcher/teams","hooks_url":"https://api.github.com/repos/resin-io/etcher/hooks","issue_events_url":"https://api.github.com/repos/resin-io/etcher/issues/events{/number}","events_url":"https://api.github.com/repos/resin-io/etcher/events","assignees_url":"https://api.github.com/repos/resin-io/etcher/assignees{/user}","branches_url":"https://api.github.com/repos/resin-io/etcher/branches{/branch}","tags_url":"https://api.github.com/repos/resin-io/etcher/tags","blobs_url":"https://api.github.com/repos/resin-io/etcher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/resin-io/etcher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/resin-io/etcher/git/refs{/sha}","trees_url":"https://api.github.com/repos/resin-io/etcher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/resin-io/etcher/statuses/{sha}","languages_url":"https://api.github.com/repos/resin-io/etcher/languages","stargazers_url":"https://api.github.com/repos/resin-io/etcher/stargazers","contributors_url":"https://api.github.com/repos/resin-io/etcher/contributors","subscribers_url":"https://api.github.com/repos/resin-io/etcher/subscribers","subscription_url":"https://api.github.com/repos/resin-io/etcher/subscription","commits_url":"https://api.github.com/repos/resin-io/etcher/commits{/sha}","git_commits_url":"https://api.github.com/repos/resin-io/etcher/git/commits{/sha}","comments_url":"https://api.github.com/repos/resin-io/etcher/comments{/number}","issue_comment_url":"https://api.github.com/repos/resin-io/etcher/issues/comments{/number}","contents_url":"https://api.github.com/repos/resin-io/etcher/contents/{+path}","compare_url":"https://api.github.com/repos/resin-io/etcher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/resin-io/etcher/merges","archive_url":"https://api.github.com/repos/resin-io/etcher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/resin-io/etcher/downloads","issues_url":"https://api.github.com/repos/resin-io/etcher/issues{/number}","pulls_url":"https://api.github.com/repos/resin-io/etcher/pulls{/number}","milestones_url":"https://api.github.com/repos/resin-io/etcher/milestones{/number}","notifications_url":"https://api.github.com/repos/resin-io/etcher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/resin-io/etcher/labels{/name}","releases_url":"https://api.github.com/repos/resin-io/etcher/releases{/id}","deployments_url":"https://api.github.com/repos/resin-io/etcher/deployments","created_at":"2015-10-27T16:53:23Z","updated_at":"2016-12-07T16:49:11Z","pushed_at":"2016-12-07T17:34:27Z","git_url":"git://github.com/resin-io/etcher.git","ssh_url":"git@github.com:resin-io/etcher.git","clone_url":"https://github.com/resin-io/etcher.git","svn_url":"https://github.com/resin-io/etcher","homepage":"https://etcher.io","size":12063,"stargazers_count":1410,"watchers_count":1410,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":81,"mirror_url":null,"open_issues_count":75,"forks":81,"open_issues":75,"watchers":1410,"default_branch":"master"}},"base":{"label":"resin-io:master","ref":"master","sha":"316d4625264f16696fcf5385f09a54c6a2497762","user":{"login":"resin-io","id":6157842,"avatar_url":"https://avatars.githubusercontent.com/u/6157842?v=3","gravatar_id":"","url":"https://api.github.com/users/resin-io","html_url":"https://github.com/resin-io","followers_url":"https://api.github.com/users/resin-io/followers","following_url":"https://api.github.com/users/resin-io/following{/other_user}","gists_url":"https://api.github.com/users/resin-io/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io/subscriptions","organizations_url":"https://api.github.com/users/resin-io/orgs","repos_url":"https://api.github.com/users/resin-io/repos","events_url":"https://api.github.com/users/resin-io/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io/received_events","type":"Organization","site_admin":false},"repo":{"id":45055693,"name":"etcher","full_name":"resin-io/etcher","owner":{"login":"resin-io","id":6157842,"avatar_url":"https://avatars.githubusercontent.com/u/6157842?v=3","gravatar_id":"","url":"https://api.github.com/users/resin-io","html_url":"https://github.com/resin-io","followers_url":"https://api.github.com/users/resin-io/followers","following_url":"https://api.github.com/users/resin-io/following{/other_user}","gists_url":"https://api.github.com/users/resin-io/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io/subscriptions","organizations_url":"https://api.github.com/users/resin-io/orgs","repos_url":"https://api.github.com/users/resin-io/repos","events_url":"https://api.github.com/users/resin-io/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/resin-io/etcher","description":"Flash OS images to SD cards & USB drives, safely and easily.","fork":false,"url":"https://api.github.com/repos/resin-io/etcher","forks_url":"https://api.github.com/repos/resin-io/etcher/forks","keys_url":"https://api.github.com/repos/resin-io/etcher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/resin-io/etcher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/resin-io/etcher/teams","hooks_url":"https://api.github.com/repos/resin-io/etcher/hooks","issue_events_url":"https://api.github.com/repos/resin-io/etcher/issues/events{/number}","events_url":"https://api.github.com/repos/resin-io/etcher/events","assignees_url":"https://api.github.com/repos/resin-io/etcher/assignees{/user}","branches_url":"https://api.github.com/repos/resin-io/etcher/branches{/branch}","tags_url":"https://api.github.com/repos/resin-io/etcher/tags","blobs_url":"https://api.github.com/repos/resin-io/etcher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/resin-io/etcher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/resin-io/etcher/git/refs{/sha}","trees_url":"https://api.github.com/repos/resin-io/etcher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/resin-io/etcher/statuses/{sha}","languages_url":"https://api.github.com/repos/resin-io/etcher/languages","stargazers_url":"https://api.github.com/repos/resin-io/etcher/stargazers","contributors_url":"https://api.github.com/repos/resin-io/etcher/contributors","subscribers_url":"https://api.github.com/repos/resin-io/etcher/subscribers","subscription_url":"https://api.github.com/repos/resin-io/etcher/subscription","commits_url":"https://api.github.com/repos/resin-io/etcher/commits{/sha}","git_commits_url":"https://api.github.com/repos/resin-io/etcher/git/commits{/sha}","comments_url":"https://api.github.com/repos/resin-io/etcher/comments{/number}","issue_comment_url":"https://api.github.com/repos/resin-io/etcher/issues/comments{/number}","contents_url":"https://api.github.com/repos/resin-io/etcher/contents/{+path}","compare_url":"https://api.github.com/repos/resin-io/etcher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/resin-io/etcher/merges","archive_url":"https://api.github.com/repos/resin-io/etcher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/resin-io/etcher/downloads","issues_url":"https://api.github.com/repos/resin-io/etcher/issues{/number}","pulls_url":"https://api.github.com/repos/resin-io/etcher/pulls{/number}","milestones_url":"https://api.github.com/repos/resin-io/etcher/milestones{/number}","notifications_url":"https://api.github.com/repos/resin-io/etcher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/resin-io/etcher/labels{/name}","releases_url":"https://api.github.com/repos/resin-io/etcher/releases{/id}","deployments_url":"https://api.github.com/repos/resin-io/etcher/deployments","created_at":"2015-10-27T16:53:23Z","updated_at":"2016-12-07T16:49:11Z","pushed_at":"2016-12-07T17:34:27Z","git_url":"git://github.com/resin-io/etcher.git","ssh_url":"git@github.com:resin-io/etcher.git","clone_url":"https://github.com/resin-io/etcher.git","svn_url":"https://github.com/resin-io/etcher","homepage":"https://etcher.io","size":12063,"stargazers_count":1410,"watchers_count":1410,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":81,"mirror_url":null,"open_issues_count":75,"forks":81,"open_issues":75,"watchers":1410,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/resin-io/etcher/pulls/936"},"html":{"href":"https://github.com/resin-io/etcher/pull/936"},"issue":{"href":"https://api.github.com/repos/resin-io/etcher/issues/936"},"comments":{"href":"https://api.github.com/repos/resin-io/etcher/issues/936/comments"},"review_comments":{"href":"https://api.github.com/repos/resin-io/etcher/pulls/936/comments"},"review_comment":{"href":"https://api.github.com/repos/resin-io/etcher/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/resin-io/etcher/pulls/936/commits"},"statuses":{"href":"https://api.github.com/repos/resin-io/etcher/statuses/9c34f7367657b53486f30e72b73a4425a7954374"}}}}
{"actor":{"display_login":"lurch"}}