{"action":"created","comment":{"url":"https://api.github.com/repos/alichtman/shallow-backup/pulls/comments/244660855","pull_request_review_id":188583066,"id":244660855,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NDY2MDg1NQ==","diff_hunk":"@@ -12,10 +12,10 @@ def run_cmd(command):\n \t\"\"\"\n \ttry:\n \t\tif not isinstance(command, list):\n-\t\t\tprocess = sp.run(command.split(), stdout=sp.PIPE)\n+\t\t\tprocess = sp.run(command.split(), stdout=sp.PIPE, stderr=sp.DEVNULL)\n \t\t\treturn process\n \t\telse:\n-\t\t\tprocess = sp.run(command, stdout=sp.PIPE)\n+\t\t\tprocess = sp.run(command, stdout=sp.PIPE, stderr=sp.DEVNULL)","path":"shallow_backup/utils.py","position":9,"original_position":9,"commit_id":"6584ba7b071b829777fc79b838bd2963996c652c","original_commit_id":"6584ba7b071b829777fc79b838bd2963996c652c","user":{"login":"codacy-bot","id":19940114,"node_id":"MDQ6VXNlcjE5OTQwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://app.codacy.com/assets/images/favicon.png) Issue found: [subprocess call - check for execution of untrusted input.](https://app.codacy.com/app/alichtman/shallow-backup/pullRequest?prid=2793992)","created_at":"2019-01-02T04:12:20Z","updated_at":"2019-01-02T04:12:21Z","html_url":"https://github.com/alichtman/shallow-backup/pull/207#discussion_r244660855","pull_request_url":"https://api.github.com/repos/alichtman/shallow-backup/pulls/207","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/alichtman/shallow-backup/pulls/comments/244660855"},"html":{"href":"https://github.com/alichtman/shallow-backup/pull/207#discussion_r244660855"},"pull_request":{"href":"https://api.github.com/repos/alichtman/shallow-backup/pulls/207"}}},"pull_request":{"url":"https://api.github.com/repos/alichtman/shallow-backup/pulls/207","id":241067175,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxMDY3MTc1","html_url":"https://github.com/alichtman/shallow-backup/pull/207","diff_url":"https://github.com/alichtman/shallow-backup/pull/207.diff","patch_url":"https://github.com/alichtman/shallow-backup/pull/207.patch","issue_url":"https://api.github.com/repos/alichtman/shallow-backup/issues/207","number":207,"state":"open","locked":false,"title":"Exception handling","user":{"login":"bl0nd","id":25558240,"node_id":"MDQ6VXNlcjI1NTU4MjQw","avatar_url":"https://avatars0.githubusercontent.com/u/25558240?v=4","gravatar_id":"","url":"https://api.github.com/users/bl0nd","html_url":"https://github.com/bl0nd","followers_url":"https://api.github.com/users/bl0nd/followers","following_url":"https://api.github.com/users/bl0nd/following{/other_user}","gists_url":"https://api.github.com/users/bl0nd/gists{/gist_id}","starred_url":"https://api.github.com/users/bl0nd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bl0nd/subscriptions","organizations_url":"https://api.github.com/users/bl0nd/orgs","repos_url":"https://api.github.com/users/bl0nd/repos","events_url":"https://api.github.com/users/bl0nd/events{/privacy}","received_events_url":"https://api.github.com/users/bl0nd/received_events","type":"User","site_admin":false},"body":"So this PR is a fix for most things that I found which could be fixed without major refactoring, including:\r\n1. Specifying the backup path to a file (via prompt and `--new_path`).\r\n2. KeyboardInterrupts at menus and prompts.\r\n3. Failed but installed commands ran while backing up packages outputted error messages to STDOUT. This was the case for cargo's backup which ran `ls xxx/.cargo/bin` when I didn't have cargo.\r\n4. There was a `configs_mapping` instead of `config_mapping` in `reinstall_configs()` when accessing the config dict.\r\n5. Minor refactoring so that not installed packages won't get a backup directory so we don't need a for loop to clean those up.\r\n6. Reinstalling packages without package backups errored out so now you get prompted to backup packages first.\r\n\r\nI tried to follow your lead of allowing users to fix the issues themselves by reprompting and things like that but if you have any further suggestions I'll try my best to do them.\r\n\r\nFor some of the unfixed problems (critical and otherwise) like failing to reinstall configs for an already existing Sublime Text 3 because copytree() doesn't overwrite, I'll make a separate issue. The main reason for not fixing them in this PR was just because I didn't want to do major code revisions, I just wanted to focus on general handling in this one.","created_at":"2018-12-27T03:24:58Z","updated_at":"2019-01-02T04:12:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4dc850bbfd0b58fd494b9e8ecedfb6a83df60c54","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/alichtman/shallow-backup/pulls/207/commits","review_comments_url":"https://api.github.com/repos/alichtman/shallow-backup/pulls/207/comments","review_comment_url":"https://api.github.com/repos/alichtman/shallow-backup/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alichtman/shallow-backup/issues/207/comments","statuses_url":"https://api.github.com/repos/alichtman/shallow-backup/statuses/6584ba7b071b829777fc79b838bd2963996c652c","head":{"label":"bl0nd:exception_handling","ref":"exception_handling","sha":"6584ba7b071b829777fc79b838bd2963996c652c","user":{"login":"bl0nd","id":25558240,"node_id":"MDQ6VXNlcjI1NTU4MjQw","avatar_url":"https://avatars0.githubusercontent.com/u/25558240?v=4","gravatar_id":"","url":"https://api.github.com/users/bl0nd","html_url":"https://github.com/bl0nd","followers_url":"https://api.github.com/users/bl0nd/followers","following_url":"https://api.github.com/users/bl0nd/following{/other_user}","gists_url":"https://api.github.com/users/bl0nd/gists{/gist_id}","starred_url":"https://api.github.com/users/bl0nd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bl0nd/subscriptions","organizations_url":"https://api.github.com/users/bl0nd/orgs","repos_url":"https://api.github.com/users/bl0nd/repos","events_url":"https://api.github.com/users/bl0nd/events{/privacy}","received_events_url":"https://api.github.com/users/bl0nd/received_events","type":"User","site_admin":false},"repo":{"id":163240245,"node_id":"MDEwOlJlcG9zaXRvcnkxNjMyNDAyNDU=","name":"shallow-backup","full_name":"bl0nd/shallow-backup","private":false,"owner":{"login":"bl0nd","id":25558240,"node_id":"MDQ6VXNlcjI1NTU4MjQw","avatar_url":"https://avatars0.githubusercontent.com/u/25558240?v=4","gravatar_id":"","url":"https://api.github.com/users/bl0nd","html_url":"https://github.com/bl0nd","followers_url":"https://api.github.com/users/bl0nd/followers","following_url":"https://api.github.com/users/bl0nd/following{/other_user}","gists_url":"https://api.github.com/users/bl0nd/gists{/gist_id}","starred_url":"https://api.github.com/users/bl0nd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bl0nd/subscriptions","organizations_url":"https://api.github.com/users/bl0nd/orgs","repos_url":"https://api.github.com/users/bl0nd/repos","events_url":"https://api.github.com/users/bl0nd/events{/privacy}","received_events_url":"https://api.github.com/users/bl0nd/received_events","type":"User","site_admin":false},"html_url":"https://github.com/bl0nd/shallow-backup","description":"Git integrated backup tool for macOS and Linux devs.","fork":true,"url":"https://api.github.com/repos/bl0nd/shallow-backup","forks_url":"https://api.github.com/repos/bl0nd/shallow-backup/forks","keys_url":"https://api.github.com/repos/bl0nd/shallow-backup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bl0nd/shallow-backup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bl0nd/shallow-backup/teams","hooks_url":"https://api.github.com/repos/bl0nd/shallow-backup/hooks","issue_events_url":"https://api.github.com/repos/bl0nd/shallow-backup/issues/events{/number}","events_url":"https://api.github.com/repos/bl0nd/shallow-backup/events","assignees_url":"https://api.github.com/repos/bl0nd/shallow-backup/assignees{/user}","branches_url":"https://api.github.com/repos/bl0nd/shallow-backup/branches{/branch}","tags_url":"https://api.github.com/repos/bl0nd/shallow-backup/tags","blobs_url":"https://api.github.com/repos/bl0nd/shallow-backup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bl0nd/shallow-backup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bl0nd/shallow-backup/git/refs{/sha}","trees_url":"https://api.github.com/repos/bl0nd/shallow-backup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bl0nd/shallow-backup/statuses/{sha}","languages_url":"https://api.github.com/repos/bl0nd/shallow-backup/languages","stargazers_url":"https://api.github.com/repos/bl0nd/shallow-backup/stargazers","contributors_url":"https://api.github.com/repos/bl0nd/shallow-backup/contributors","subscribers_url":"https://api.github.com/repos/bl0nd/shallow-backup/subscribers","subscription_url":"https://api.github.com/repos/bl0nd/shallow-backup/subscription","commits_url":"https://api.github.com/repos/bl0nd/shallow-backup/commits{/sha}","git_commits_url":"https://api.github.com/repos/bl0nd/shallow-backup/git/commits{/sha}","comments_url":"https://api.github.com/repos/bl0nd/shallow-backup/comments{/number}","issue_comment_url":"https://api.github.com/repos/bl0nd/shallow-backup/issues/comments{/number}","contents_url":"https://api.github.com/repos/bl0nd/shallow-backup/contents/{+path}","compare_url":"https://api.github.com/repos/bl0nd/shallow-backup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bl0nd/shallow-backup/merges","archive_url":"https://api.github.com/repos/bl0nd/shallow-backup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bl0nd/shallow-backup/downloads","issues_url":"https://api.github.com/repos/bl0nd/shallow-backup/issues{/number}","pulls_url":"https://api.github.com/repos/bl0nd/shallow-backup/pulls{/number}","milestones_url":"https://api.github.com/repos/bl0nd/shallow-backup/milestones{/number}","notifications_url":"https://api.github.com/repos/bl0nd/shallow-backup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bl0nd/shallow-backup/labels{/name}","releases_url":"https://api.github.com/repos/bl0nd/shallow-backup/releases{/id}","deployments_url":"https://api.github.com/repos/bl0nd/shallow-backup/deployments","created_at":"2018-12-27T03:00:57Z","updated_at":"2018-12-27T03:00:59Z","pushed_at":"2019-01-02T04:10:54Z","git_url":"git://github.com/bl0nd/shallow-backup.git","ssh_url":"git@github.com:bl0nd/shallow-backup.git","clone_url":"https://github.com/bl0nd/shallow-backup.git","svn_url":"https://github.com/bl0nd/shallow-backup","homepage":"","size":9027,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"alichtman:master","ref":"master","sha":"4214d478ef9f520237b6d685219bdcead14bbb74","user":{"login":"alichtman","id":20600565,"node_id":"MDQ6VXNlcjIwNjAwNTY1","avatar_url":"https://avatars2.githubusercontent.com/u/20600565?v=4","gravatar_id":"","url":"https://api.github.com/users/alichtman","html_url":"https://github.com/alichtman","followers_url":"https://api.github.com/users/alichtman/followers","following_url":"https://api.github.com/users/alichtman/following{/other_user}","gists_url":"https://api.github.com/users/alichtman/gists{/gist_id}","starred_url":"https://api.github.com/users/alichtman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alichtman/subscriptions","organizations_url":"https://api.github.com/users/alichtman/orgs","repos_url":"https://api.github.com/users/alichtman/repos","events_url":"https://api.github.com/users/alichtman/events{/privacy}","received_events_url":"https://api.github.com/users/alichtman/received_events","type":"User","site_admin":false},"repo":{"id":126676280,"node_id":"MDEwOlJlcG9zaXRvcnkxMjY2NzYyODA=","name":"shallow-backup","full_name":"alichtman/shallow-backup","private":false,"owner":{"login":"alichtman","id":20600565,"node_id":"MDQ6VXNlcjIwNjAwNTY1","avatar_url":"https://avatars2.githubusercontent.com/u/20600565?v=4","gravatar_id":"","url":"https://api.github.com/users/alichtman","html_url":"https://github.com/alichtman","followers_url":"https://api.github.com/users/alichtman/followers","following_url":"https://api.github.com/users/alichtman/following{/other_user}","gists_url":"https://api.github.com/users/alichtman/gists{/gist_id}","starred_url":"https://api.github.com/users/alichtman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alichtman/subscriptions","organizations_url":"https://api.github.com/users/alichtman/orgs","repos_url":"https://api.github.com/users/alichtman/repos","events_url":"https://api.github.com/users/alichtman/events{/privacy}","received_events_url":"https://api.github.com/users/alichtman/received_events","type":"User","site_admin":false},"html_url":"https://github.com/alichtman/shallow-backup","description":"Git integrated backup tool for macOS and Linux devs.","fork":false,"url":"https://api.github.com/repos/alichtman/shallow-backup","forks_url":"https://api.github.com/repos/alichtman/shallow-backup/forks","keys_url":"https://api.github.com/repos/alichtman/shallow-backup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alichtman/shallow-backup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alichtman/shallow-backup/teams","hooks_url":"https://api.github.com/repos/alichtman/shallow-backup/hooks","issue_events_url":"https://api.github.com/repos/alichtman/shallow-backup/issues/events{/number}","events_url":"https://api.github.com/repos/alichtman/shallow-backup/events","assignees_url":"https://api.github.com/repos/alichtman/shallow-backup/assignees{/user}","branches_url":"https://api.github.com/repos/alichtman/shallow-backup/branches{/branch}","tags_url":"https://api.github.com/repos/alichtman/shallow-backup/tags","blobs_url":"https://api.github.com/repos/alichtman/shallow-backup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alichtman/shallow-backup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alichtman/shallow-backup/git/refs{/sha}","trees_url":"https://api.github.com/repos/alichtman/shallow-backup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alichtman/shallow-backup/statuses/{sha}","languages_url":"https://api.github.com/repos/alichtman/shallow-backup/languages","stargazers_url":"https://api.github.com/repos/alichtman/shallow-backup/stargazers","contributors_url":"https://api.github.com/repos/alichtman/shallow-backup/contributors","subscribers_url":"https://api.github.com/repos/alichtman/shallow-backup/subscribers","subscription_url":"https://api.github.com/repos/alichtman/shallow-backup/subscription","commits_url":"https://api.github.com/repos/alichtman/shallow-backup/commits{/sha}","git_commits_url":"https://api.github.com/repos/alichtman/shallow-backup/git/commits{/sha}","comments_url":"https://api.github.com/repos/alichtman/shallow-backup/comments{/number}","issue_comment_url":"https://api.github.com/repos/alichtman/shallow-backup/issues/comments{/number}","contents_url":"https://api.github.com/repos/alichtman/shallow-backup/contents/{+path}","compare_url":"https://api.github.com/repos/alichtman/shallow-backup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alichtman/shallow-backup/merges","archive_url":"https://api.github.com/repos/alichtman/shallow-backup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alichtman/shallow-backup/downloads","issues_url":"https://api.github.com/repos/alichtman/shallow-backup/issues{/number}","pulls_url":"https://api.github.com/repos/alichtman/shallow-backup/pulls{/number}","milestones_url":"https://api.github.com/repos/alichtman/shallow-backup/milestones{/number}","notifications_url":"https://api.github.com/repos/alichtman/shallow-backup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alichtman/shallow-backup/labels{/name}","releases_url":"https://api.github.com/repos/alichtman/shallow-backup/releases{/id}","deployments_url":"https://api.github.com/repos/alichtman/shallow-backup/deployments","created_at":"2018-03-25T07:59:19Z","updated_at":"2018-12-30T22:37:23Z","pushed_at":"2019-01-02T04:10:55Z","git_url":"git://github.com/alichtman/shallow-backup.git","ssh_url":"git@github.com:alichtman/shallow-backup.git","clone_url":"https://github.com/alichtman/shallow-backup.git","svn_url":"https://github.com/alichtman/shallow-backup","homepage":"","size":8990,"stargazers_count":269,"watchers_count":269,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":38,"mirror_url":null,"archived":false,"open_issues_count":19,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":38,"open_issues":19,"watchers":269,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alichtman/shallow-backup/pulls/207"},"html":{"href":"https://github.com/alichtman/shallow-backup/pull/207"},"issue":{"href":"https://api.github.com/repos/alichtman/shallow-backup/issues/207"},"comments":{"href":"https://api.github.com/repos/alichtman/shallow-backup/issues/207/comments"},"review_comments":{"href":"https://api.github.com/repos/alichtman/shallow-backup/pulls/207/comments"},"review_comment":{"href":"https://api.github.com/repos/alichtman/shallow-backup/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alichtman/shallow-backup/pulls/207/commits"},"statuses":{"href":"https://api.github.com/repos/alichtman/shallow-backup/statuses/6584ba7b071b829777fc79b838bd2963996c652c"}},"author_association":"NONE"}}
{"actor":{"display_login":"codacy-bot"}}