{"action":"created","comment":{"url":"https://api.github.com/repos/chrischu5/codecore_homework/pulls/comments/224281958","pull_request_review_id":163608468,"id":224281958,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDI4MTk1OA==","diff_hunk":"@@ -0,0 +1,136 @@\n+//--------------------------\n+// MODULES\n+//--------------------------\n+const fs = require(\"fs\"),\n+  readLine = require(\"readline\"),\n+  r1 = readLine.createInterface({\n+    input: process.stdin,\n+    output: process.stdout\n+  }),\n+  args = process.argv.slice(2),\n+  todoFile = args[0];\n+\n+//--------------------------\n+// FUNCTIONS\n+//--------------------------\n+function add() {\n+  r1.question(\"Input your new task: \", (answer) => {\n+    todoArr.push(`${counter} [-]: ${answer}`);\n+    counter += 1;\n+    console.log(`Task added: ${answer}`);\n+    r1.prompt();\n+  })\n+};\n+\n+function complete(input) {\n+  let command = input.split(/(\\d+)/);\n+  let taskIndex = parseInt(command[1]);\n+  todoArr[taskIndex] = todoArr[taskIndex].replace(\"[-]\", \"[✓]\");\n+  console.log(`Completed: ${todoArr[taskIndex]}`);\n+  r1.prompt();\n+};\n+\n+function del(input) {\n+  let command = input.split(/(\\d+)/);\n+  let taskIndex = parseInt(command[1]);\n+  console.log(`Deleted: ${todoArr[taskIndex]}`);\n+  todoArr.splice(taskIndex);\n+  r1.prompt();\n+};\n+\n+//--------------------------\n+// VARIABLES\n+//--------------------------\n+let todoArr = [];\n+let counter = 0;\n+let todoWrite = [];\n+\n+//--------------------------\n+// READ JSON FILE\n+//--------------------------\n+if (todoFile === undefined){\n+  console.log(\"No file provided. Resuming normal functionalities!\\n--------------------\\n\");\n+} else {\n+  fs.readFile(todoFile, \"utf8\", (err, data) => {\n+    if (err) throw err;\n+    obj = JSON.parse(data);\n+    for (let i = 0; i < obj.length; i += 1) {\n+      if (obj[i][\"completed\"] === true){","path":"todoCLI/todoCLI.js","position":58,"original_position":58,"commit_id":"b3807d98d0744cca9ed66dcbb8c7b68065d557f1","original_commit_id":"b3807d98d0744cca9ed66dcbb8c7b68065d557f1","user":{"login":"tgeatbt","id":43012543,"node_id":"MDQ6VXNlcjQzMDEyNTQz","avatar_url":"https://avatars1.githubusercontent.com/u/43012543?v=4","gravatar_id":"","url":"https://api.github.com/users/tgeatbt","html_url":"https://github.com/tgeatbt","followers_url":"https://api.github.com/users/tgeatbt/followers","following_url":"https://api.github.com/users/tgeatbt/following{/other_user}","gists_url":"https://api.github.com/users/tgeatbt/gists{/gist_id}","starred_url":"https://api.github.com/users/tgeatbt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgeatbt/subscriptions","organizations_url":"https://api.github.com/users/tgeatbt/orgs","repos_url":"https://api.github.com/users/tgeatbt/repos","events_url":"https://api.github.com/users/tgeatbt/events{/privacy}","received_events_url":"https://api.github.com/users/tgeatbt/received_events","type":"User","site_admin":false},"body":"you don't really need the `=== true` since `obj[i][\"completed\"]` already is a boolean. ","created_at":"2018-10-11T00:25:50Z","updated_at":"2018-10-11T00:38:20Z","html_url":"https://github.com/chrischu5/codecore_homework/pull/3#discussion_r224281958","pull_request_url":"https://api.github.com/repos/chrischu5/codecore_homework/pulls/3","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/chrischu5/codecore_homework/pulls/comments/224281958"},"html":{"href":"https://github.com/chrischu5/codecore_homework/pull/3#discussion_r224281958"},"pull_request":{"href":"https://api.github.com/repos/chrischu5/codecore_homework/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/chrischu5/codecore_homework/pulls/3","id":220739940,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIwNzM5OTQw","html_url":"https://github.com/chrischu5/codecore_homework/pull/3","diff_url":"https://github.com/chrischu5/codecore_homework/pull/3.diff","patch_url":"https://github.com/chrischu5/codecore_homework/pull/3.patch","issue_url":"https://api.github.com/repos/chrischu5/codecore_homework/issues/3","number":3,"state":"open","locked":false,"title":"Todo cli","user":{"login":"chrischu5","id":29137273,"node_id":"MDQ6VXNlcjI5MTM3Mjcz","avatar_url":"https://avatars1.githubusercontent.com/u/29137273?v=4","gravatar_id":"","url":"https://api.github.com/users/chrischu5","html_url":"https://github.com/chrischu5","followers_url":"https://api.github.com/users/chrischu5/followers","following_url":"https://api.github.com/users/chrischu5/following{/other_user}","gists_url":"https://api.github.com/users/chrischu5/gists{/gist_id}","starred_url":"https://api.github.com/users/chrischu5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrischu5/subscriptions","organizations_url":"https://api.github.com/users/chrischu5/orgs","repos_url":"https://api.github.com/users/chrischu5/repos","events_url":"https://api.github.com/users/chrischu5/events{/privacy}","received_events_url":"https://api.github.com/users/chrischu5/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-05T15:27:04Z","updated_at":"2018-10-11T00:38:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"39576fee39cb1f59760d7e892f151eb5aee49b25","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/chrischu5/codecore_homework/pulls/3/commits","review_comments_url":"https://api.github.com/repos/chrischu5/codecore_homework/pulls/3/comments","review_comment_url":"https://api.github.com/repos/chrischu5/codecore_homework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chrischu5/codecore_homework/issues/3/comments","statuses_url":"https://api.github.com/repos/chrischu5/codecore_homework/statuses/b3807d98d0744cca9ed66dcbb8c7b68065d557f1","head":{"label":"chrischu5:todoCLI","ref":"todoCLI","sha":"b3807d98d0744cca9ed66dcbb8c7b68065d557f1","user":{"login":"chrischu5","id":29137273,"node_id":"MDQ6VXNlcjI5MTM3Mjcz","avatar_url":"https://avatars1.githubusercontent.com/u/29137273?v=4","gravatar_id":"","url":"https://api.github.com/users/chrischu5","html_url":"https://github.com/chrischu5","followers_url":"https://api.github.com/users/chrischu5/followers","following_url":"https://api.github.com/users/chrischu5/following{/other_user}","gists_url":"https://api.github.com/users/chrischu5/gists{/gist_id}","starred_url":"https://api.github.com/users/chrischu5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrischu5/subscriptions","organizations_url":"https://api.github.com/users/chrischu5/orgs","repos_url":"https://api.github.com/users/chrischu5/repos","events_url":"https://api.github.com/users/chrischu5/events{/privacy}","received_events_url":"https://api.github.com/users/chrischu5/received_events","type":"User","site_admin":false},"repo":{"id":148820031,"node_id":"MDEwOlJlcG9zaXRvcnkxNDg4MjAwMzE=","name":"codecore_homework","full_name":"chrischu5/codecore_homework","private":false,"owner":{"login":"chrischu5","id":29137273,"node_id":"MDQ6VXNlcjI5MTM3Mjcz","avatar_url":"https://avatars1.githubusercontent.com/u/29137273?v=4","gravatar_id":"","url":"https://api.github.com/users/chrischu5","html_url":"https://github.com/chrischu5","followers_url":"https://api.github.com/users/chrischu5/followers","following_url":"https://api.github.com/users/chrischu5/following{/other_user}","gists_url":"https://api.github.com/users/chrischu5/gists{/gist_id}","starred_url":"https://api.github.com/users/chrischu5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrischu5/subscriptions","organizations_url":"https://api.github.com/users/chrischu5/orgs","repos_url":"https://api.github.com/users/chrischu5/repos","events_url":"https://api.github.com/users/chrischu5/events{/privacy}","received_events_url":"https://api.github.com/users/chrischu5/received_events","type":"User","site_admin":false},"html_url":"https://github.com/chrischu5/codecore_homework","description":"Homework assignments during CodeCore bootcamp!","fork":false,"url":"https://api.github.com/repos/chrischu5/codecore_homework","forks_url":"https://api.github.com/repos/chrischu5/codecore_homework/forks","keys_url":"https://api.github.com/repos/chrischu5/codecore_homework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chrischu5/codecore_homework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chrischu5/codecore_homework/teams","hooks_url":"https://api.github.com/repos/chrischu5/codecore_homework/hooks","issue_events_url":"https://api.github.com/repos/chrischu5/codecore_homework/issues/events{/number}","events_url":"https://api.github.com/repos/chrischu5/codecore_homework/events","assignees_url":"https://api.github.com/repos/chrischu5/codecore_homework/assignees{/user}","branches_url":"https://api.github.com/repos/chrischu5/codecore_homework/branches{/branch}","tags_url":"https://api.github.com/repos/chrischu5/codecore_homework/tags","blobs_url":"https://api.github.com/repos/chrischu5/codecore_homework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chrischu5/codecore_homework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chrischu5/codecore_homework/git/refs{/sha}","trees_url":"https://api.github.com/repos/chrischu5/codecore_homework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chrischu5/codecore_homework/statuses/{sha}","languages_url":"https://api.github.com/repos/chrischu5/codecore_homework/languages","stargazers_url":"https://api.github.com/repos/chrischu5/codecore_homework/stargazers","contributors_url":"https://api.github.com/repos/chrischu5/codecore_homework/contributors","subscribers_url":"https://api.github.com/repos/chrischu5/codecore_homework/subscribers","subscription_url":"https://api.github.com/repos/chrischu5/codecore_homework/subscription","commits_url":"https://api.github.com/repos/chrischu5/codecore_homework/commits{/sha}","git_commits_url":"https://api.github.com/repos/chrischu5/codecore_homework/git/commits{/sha}","comments_url":"https://api.github.com/repos/chrischu5/codecore_homework/comments{/number}","issue_comment_url":"https://api.github.com/repos/chrischu5/codecore_homework/issues/comments{/number}","contents_url":"https://api.github.com/repos/chrischu5/codecore_homework/contents/{+path}","compare_url":"https://api.github.com/repos/chrischu5/codecore_homework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chrischu5/codecore_homework/merges","archive_url":"https://api.github.com/repos/chrischu5/codecore_homework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chrischu5/codecore_homework/downloads","issues_url":"https://api.github.com/repos/chrischu5/codecore_homework/issues{/number}","pulls_url":"https://api.github.com/repos/chrischu5/codecore_homework/pulls{/number}","milestones_url":"https://api.github.com/repos/chrischu5/codecore_homework/milestones{/number}","notifications_url":"https://api.github.com/repos/chrischu5/codecore_homework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chrischu5/codecore_homework/labels{/name}","releases_url":"https://api.github.com/repos/chrischu5/codecore_homework/releases{/id}","deployments_url":"https://api.github.com/repos/chrischu5/codecore_homework/deployments","created_at":"2018-09-14T17:18:07Z","updated_at":"2018-10-05T15:37:08Z","pushed_at":"2018-10-05T15:37:06Z","git_url":"git://github.com/chrischu5/codecore_homework.git","ssh_url":"git@github.com:chrischu5/codecore_homework.git","clone_url":"https://github.com/chrischu5/codecore_homework.git","svn_url":"https://github.com/chrischu5/codecore_homework","homepage":null,"size":12,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"chrischu5:master","ref":"master","sha":"bf38efbc51c6dafd3b4a8adc7ec4063183d37452","user":{"login":"chrischu5","id":29137273,"node_id":"MDQ6VXNlcjI5MTM3Mjcz","avatar_url":"https://avatars1.githubusercontent.com/u/29137273?v=4","gravatar_id":"","url":"https://api.github.com/users/chrischu5","html_url":"https://github.com/chrischu5","followers_url":"https://api.github.com/users/chrischu5/followers","following_url":"https://api.github.com/users/chrischu5/following{/other_user}","gists_url":"https://api.github.com/users/chrischu5/gists{/gist_id}","starred_url":"https://api.github.com/users/chrischu5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrischu5/subscriptions","organizations_url":"https://api.github.com/users/chrischu5/orgs","repos_url":"https://api.github.com/users/chrischu5/repos","events_url":"https://api.github.com/users/chrischu5/events{/privacy}","received_events_url":"https://api.github.com/users/chrischu5/received_events","type":"User","site_admin":false},"repo":{"id":148820031,"node_id":"MDEwOlJlcG9zaXRvcnkxNDg4MjAwMzE=","name":"codecore_homework","full_name":"chrischu5/codecore_homework","private":false,"owner":{"login":"chrischu5","id":29137273,"node_id":"MDQ6VXNlcjI5MTM3Mjcz","avatar_url":"https://avatars1.githubusercontent.com/u/29137273?v=4","gravatar_id":"","url":"https://api.github.com/users/chrischu5","html_url":"https://github.com/chrischu5","followers_url":"https://api.github.com/users/chrischu5/followers","following_url":"https://api.github.com/users/chrischu5/following{/other_user}","gists_url":"https://api.github.com/users/chrischu5/gists{/gist_id}","starred_url":"https://api.github.com/users/chrischu5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrischu5/subscriptions","organizations_url":"https://api.github.com/users/chrischu5/orgs","repos_url":"https://api.github.com/users/chrischu5/repos","events_url":"https://api.github.com/users/chrischu5/events{/privacy}","received_events_url":"https://api.github.com/users/chrischu5/received_events","type":"User","site_admin":false},"html_url":"https://github.com/chrischu5/codecore_homework","description":"Homework assignments during CodeCore bootcamp!","fork":false,"url":"https://api.github.com/repos/chrischu5/codecore_homework","forks_url":"https://api.github.com/repos/chrischu5/codecore_homework/forks","keys_url":"https://api.github.com/repos/chrischu5/codecore_homework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chrischu5/codecore_homework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chrischu5/codecore_homework/teams","hooks_url":"https://api.github.com/repos/chrischu5/codecore_homework/hooks","issue_events_url":"https://api.github.com/repos/chrischu5/codecore_homework/issues/events{/number}","events_url":"https://api.github.com/repos/chrischu5/codecore_homework/events","assignees_url":"https://api.github.com/repos/chrischu5/codecore_homework/assignees{/user}","branches_url":"https://api.github.com/repos/chrischu5/codecore_homework/branches{/branch}","tags_url":"https://api.github.com/repos/chrischu5/codecore_homework/tags","blobs_url":"https://api.github.com/repos/chrischu5/codecore_homework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chrischu5/codecore_homework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chrischu5/codecore_homework/git/refs{/sha}","trees_url":"https://api.github.com/repos/chrischu5/codecore_homework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chrischu5/codecore_homework/statuses/{sha}","languages_url":"https://api.github.com/repos/chrischu5/codecore_homework/languages","stargazers_url":"https://api.github.com/repos/chrischu5/codecore_homework/stargazers","contributors_url":"https://api.github.com/repos/chrischu5/codecore_homework/contributors","subscribers_url":"https://api.github.com/repos/chrischu5/codecore_homework/subscribers","subscription_url":"https://api.github.com/repos/chrischu5/codecore_homework/subscription","commits_url":"https://api.github.com/repos/chrischu5/codecore_homework/commits{/sha}","git_commits_url":"https://api.github.com/repos/chrischu5/codecore_homework/git/commits{/sha}","comments_url":"https://api.github.com/repos/chrischu5/codecore_homework/comments{/number}","issue_comment_url":"https://api.github.com/repos/chrischu5/codecore_homework/issues/comments{/number}","contents_url":"https://api.github.com/repos/chrischu5/codecore_homework/contents/{+path}","compare_url":"https://api.github.com/repos/chrischu5/codecore_homework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chrischu5/codecore_homework/merges","archive_url":"https://api.github.com/repos/chrischu5/codecore_homework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chrischu5/codecore_homework/downloads","issues_url":"https://api.github.com/repos/chrischu5/codecore_homework/issues{/number}","pulls_url":"https://api.github.com/repos/chrischu5/codecore_homework/pulls{/number}","milestones_url":"https://api.github.com/repos/chrischu5/codecore_homework/milestones{/number}","notifications_url":"https://api.github.com/repos/chrischu5/codecore_homework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chrischu5/codecore_homework/labels{/name}","releases_url":"https://api.github.com/repos/chrischu5/codecore_homework/releases{/id}","deployments_url":"https://api.github.com/repos/chrischu5/codecore_homework/deployments","created_at":"2018-09-14T17:18:07Z","updated_at":"2018-10-05T15:37:08Z","pushed_at":"2018-10-05T15:37:06Z","git_url":"git://github.com/chrischu5/codecore_homework.git","ssh_url":"git@github.com:chrischu5/codecore_homework.git","clone_url":"https://github.com/chrischu5/codecore_homework.git","svn_url":"https://github.com/chrischu5/codecore_homework","homepage":null,"size":12,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chrischu5/codecore_homework/pulls/3"},"html":{"href":"https://github.com/chrischu5/codecore_homework/pull/3"},"issue":{"href":"https://api.github.com/repos/chrischu5/codecore_homework/issues/3"},"comments":{"href":"https://api.github.com/repos/chrischu5/codecore_homework/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/chrischu5/codecore_homework/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/chrischu5/codecore_homework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chrischu5/codecore_homework/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/chrischu5/codecore_homework/statuses/b3807d98d0744cca9ed66dcbb8c7b68065d557f1"}},"author_association":"OWNER"}}
{"actor":{"display_login":"tgeatbt"}}