{"action":"created","comment":{"url":"https://api.github.com/repos/google/clasp/pulls/comments/179525807","pull_request_review_id":109786187,"id":179525807,"diff_hunk":"@@ -593,102 +688,74 @@ commander\n       await checkIfOnline();\n       getProjectSettings().then(({ scriptId, rootDir }: ProjectSettings) => {\n         if (!scriptId) return;\n-        // Read all filenames as a flattened tree\n-        recursive(rootDir || path.join('.', '/'), (err, filePaths) => {\n-          if (err) return logError(err);\n-          // Filter files that aren't allowed.\n-          filePaths = filePaths.filter((name) => !name.startsWith('.'));\n-          DOTFILE.IGNORE().then((ignorePatterns: string[]) => {\n-            filePaths = filePaths.sort(); // Sort files alphanumerically\n-            let abortPush = false;\n-\n-            // Match the files with ignored glob pattern\n-            readMultipleFiles(filePaths, 'utf8', (err: string, contents: string[]) => {\n-              if (err) return console.error(err);\n-              const nonIgnoredFilePaths: string[] = [];\n-\n-              // Check if there are any .gs files\n-              // We will prompt the user to rename files\n-              let canRenameToJS = false;\n-              filePaths.map((name, i) => {\n-                if (path.extname(name) === '.gs') {\n-                  canRenameToJS = true;\n-                }\n-              });\n-\n-              // Check if there are files that will conflict if renamed .gs to .js\n-              filePaths.map((name: string) => {\n-                const fileNameWithoutExt = name.slice(0, -path.extname(name).length);\n-                if (filePaths.indexOf(fileNameWithoutExt + '.js') !== -1 &&\n-                  filePaths.indexOf(fileNameWithoutExt + '.gs') !== -1) {\n-                  // Can't rename, conflicting files\n-                  abortPush = true;\n-                  if (path.extname(name) === '.gs') { // only print error once (for .gs)\n-                    logError(null, ERROR.CONFLICTING_FILE_EXTENSION(fileNameWithoutExt));\n-                  }\n-                } else if (path.extname(name) === '.gs') {\n-                  // rename file to js\n-                  console.log(LOG.RENAME_FILE(fileNameWithoutExt + '.gs', fileNameWithoutExt + '.js'));\n-                  fs.renameSync(fileNameWithoutExt + '.gs', fileNameWithoutExt + '.js');\n-                }\n-              });\n-              if (abortPush) return spinner.stop(true);\n-\n-              const files = filePaths.map((name, i) => {\n-                let nameWithoutExt = name.slice(0, -path.extname(name).length);\n-                // Replace OS specific path separator to common '/' char\n-                nameWithoutExt = nameWithoutExt.replace(/\\\\/g, '/');\n-\n-                // Formats rootDir/appsscript.json to appsscript.json.\n-                // Preserves subdirectory names in rootDir\n-                // (rootDir/foo/Code.js becomes foo/Code.js)\n-                let formattedName = nameWithoutExt;\n-                if (rootDir) {\n-                  formattedName = nameWithoutExt.slice(\n-                    rootDir.length + 1,\n-                    nameWithoutExt.length\n-                  );\n-                }\n-                if (getAPIFileType(name) && !anymatch(ignorePatterns, name)) {\n-                  nonIgnoredFilePaths.push(name);\n-                  const file: AppsScriptFile = {\n-                    name: formattedName, // the file base name\n-                    type: getAPIFileType(name), // the file extension\n-                    source: contents[i] //the file contents\n-                  };\n-                  return file;\n-                } else {\n-                  return; // Skip ignored files\n-                }\n-              }).filter(Boolean); // remove null values\n-\n-              script.projects.updateContent({\n-                scriptId,\n-                resource: { files }\n-              }, {}, (error: any, res: Function) => {\n-                spinner.stop(true);\n-                if (error) {\n-                  console.error(LOG.PUSH_FAILURE);\n-                  error.errors.map((err: any) => {\n-                    console.error(err.message);\n-                  });\n-                  console.error(LOG.FILES_TO_PUSH);\n-                  nonIgnoredFilePaths.map((filePath) => {\n-                    console.error(`└─ ${filePath}`);\n-                  });\n-                } else {\n-                  nonIgnoredFilePaths.map((filePath) => {\n-                    console.log(`└─ ${filePath}`);\n-                  });\n-                  console.log(LOG.PUSH_SUCCESS(nonIgnoredFilePaths.length));\n-                }\n-              });\n-            });\n+        getProjectFiles(rootDir, (err,projectFiles,files) => {","path":"index.ts","position":211,"original_position":211,"commit_id":"0ef3ce6f30ccadb434d8cd669170b889b987631c","original_commit_id":"0ef3ce6f30ccadb434d8cd669170b889b987631c","user":{"login":"grant","id":744973,"avatar_url":"https://avatars3.githubusercontent.com/u/744973?v=4","gravatar_id":"","url":"https://api.github.com/users/grant","html_url":"https://github.com/grant","followers_url":"https://api.github.com/users/grant/followers","following_url":"https://api.github.com/users/grant/following{/other_user}","gists_url":"https://api.github.com/users/grant/gists{/gist_id}","starred_url":"https://api.github.com/users/grant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grant/subscriptions","organizations_url":"https://api.github.com/users/grant/orgs","repos_url":"https://api.github.com/users/grant/repos","events_url":"https://api.github.com/users/grant/events{/privacy}","received_events_url":"https://api.github.com/users/grant/received_events","type":"User","site_admin":false},"body":"Spacing\r\n`getProjectFiles(rootDir, (err, projectFiles, files) => {`","created_at":"2018-04-05T16:36:42Z","updated_at":"2018-04-05T16:40:19Z","html_url":"https://github.com/google/clasp/pull/96#discussion_r179525807","pull_request_url":"https://api.github.com/repos/google/clasp/pulls/96","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/google/clasp/pulls/comments/179525807"},"html":{"href":"https://github.com/google/clasp/pull/96#discussion_r179525807"},"pull_request":{"href":"https://api.github.com/repos/google/clasp/pulls/96"}}},"pull_request":{"url":"https://api.github.com/repos/google/clasp/pulls/96","id":179728035,"html_url":"https://github.com/google/clasp/pull/96","diff_url":"https://github.com/google/clasp/pull/96.diff","patch_url":"https://github.com/google/clasp/pull/96.patch","issue_url":"https://api.github.com/repos/google/clasp/issues/96","number":96,"state":"closed","locked":false,"title":"FEA: Added clasp status command","user":{"login":"arjun-rao","id":6134623,"avatar_url":"https://avatars0.githubusercontent.com/u/6134623?v=4","gravatar_id":"","url":"https://api.github.com/users/arjun-rao","html_url":"https://github.com/arjun-rao","followers_url":"https://api.github.com/users/arjun-rao/followers","following_url":"https://api.github.com/users/arjun-rao/following{/other_user}","gists_url":"https://api.github.com/users/arjun-rao/gists{/gist_id}","starred_url":"https://api.github.com/users/arjun-rao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arjun-rao/subscriptions","organizations_url":"https://api.github.com/users/arjun-rao/orgs","repos_url":"https://api.github.com/users/arjun-rao/repos","events_url":"https://api.github.com/users/arjun-rao/events{/privacy}","received_events_url":"https://api.github.com/users/arjun-rao/received_events","type":"User","site_admin":false},"body":"Fixes #73 \r\n\r\n## Changes\r\n* Code to find files that need to be pushed is moved from `clasp push` to a separate function `getProjectFiles`\r\n* `status` and `push` commands call `getProjectFiles` to retrieve file lists.\r\n","created_at":"2018-04-05T16:20:18Z","updated_at":"2018-04-05T16:40:19Z","closed_at":"2018-04-05T16:34:51Z","merged_at":null,"merge_commit_sha":"178ef13eaeb9b06d887d9c34f2c8f9f5a1d5f319","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":808053223,"url":"https://api.github.com/repos/google/clasp/labels/cla:%20yes","name":"cla: yes","color":"c2e0c6","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/google/clasp/pulls/96/commits","review_comments_url":"https://api.github.com/repos/google/clasp/pulls/96/comments","review_comment_url":"https://api.github.com/repos/google/clasp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/clasp/issues/96/comments","statuses_url":"https://api.github.com/repos/google/clasp/statuses/0ef3ce6f30ccadb434d8cd669170b889b987631c","head":{"label":"arjun-rao:clasp-status","ref":"clasp-status","sha":"0ef3ce6f30ccadb434d8cd669170b889b987631c","user":{"login":"arjun-rao","id":6134623,"avatar_url":"https://avatars0.githubusercontent.com/u/6134623?v=4","gravatar_id":"","url":"https://api.github.com/users/arjun-rao","html_url":"https://github.com/arjun-rao","followers_url":"https://api.github.com/users/arjun-rao/followers","following_url":"https://api.github.com/users/arjun-rao/following{/other_user}","gists_url":"https://api.github.com/users/arjun-rao/gists{/gist_id}","starred_url":"https://api.github.com/users/arjun-rao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arjun-rao/subscriptions","organizations_url":"https://api.github.com/users/arjun-rao/orgs","repos_url":"https://api.github.com/users/arjun-rao/repos","events_url":"https://api.github.com/users/arjun-rao/events{/privacy}","received_events_url":"https://api.github.com/users/arjun-rao/received_events","type":"User","site_admin":false},"repo":{"id":122379077,"name":"clasp","full_name":"arjun-rao/clasp","owner":{"login":"arjun-rao","id":6134623,"avatar_url":"https://avatars0.githubusercontent.com/u/6134623?v=4","gravatar_id":"","url":"https://api.github.com/users/arjun-rao","html_url":"https://github.com/arjun-rao","followers_url":"https://api.github.com/users/arjun-rao/followers","following_url":"https://api.github.com/users/arjun-rao/following{/other_user}","gists_url":"https://api.github.com/users/arjun-rao/gists{/gist_id}","starred_url":"https://api.github.com/users/arjun-rao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arjun-rao/subscriptions","organizations_url":"https://api.github.com/users/arjun-rao/orgs","repos_url":"https://api.github.com/users/arjun-rao/repos","events_url":"https://api.github.com/users/arjun-rao/events{/privacy}","received_events_url":"https://api.github.com/users/arjun-rao/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/arjun-rao/clasp","description":"Develop Apps Script projects locally.","fork":true,"url":"https://api.github.com/repos/arjun-rao/clasp","forks_url":"https://api.github.com/repos/arjun-rao/clasp/forks","keys_url":"https://api.github.com/repos/arjun-rao/clasp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arjun-rao/clasp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arjun-rao/clasp/teams","hooks_url":"https://api.github.com/repos/arjun-rao/clasp/hooks","issue_events_url":"https://api.github.com/repos/arjun-rao/clasp/issues/events{/number}","events_url":"https://api.github.com/repos/arjun-rao/clasp/events","assignees_url":"https://api.github.com/repos/arjun-rao/clasp/assignees{/user}","branches_url":"https://api.github.com/repos/arjun-rao/clasp/branches{/branch}","tags_url":"https://api.github.com/repos/arjun-rao/clasp/tags","blobs_url":"https://api.github.com/repos/arjun-rao/clasp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arjun-rao/clasp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arjun-rao/clasp/git/refs{/sha}","trees_url":"https://api.github.com/repos/arjun-rao/clasp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arjun-rao/clasp/statuses/{sha}","languages_url":"https://api.github.com/repos/arjun-rao/clasp/languages","stargazers_url":"https://api.github.com/repos/arjun-rao/clasp/stargazers","contributors_url":"https://api.github.com/repos/arjun-rao/clasp/contributors","subscribers_url":"https://api.github.com/repos/arjun-rao/clasp/subscribers","subscription_url":"https://api.github.com/repos/arjun-rao/clasp/subscription","commits_url":"https://api.github.com/repos/arjun-rao/clasp/commits{/sha}","git_commits_url":"https://api.github.com/repos/arjun-rao/clasp/git/commits{/sha}","comments_url":"https://api.github.com/repos/arjun-rao/clasp/comments{/number}","issue_comment_url":"https://api.github.com/repos/arjun-rao/clasp/issues/comments{/number}","contents_url":"https://api.github.com/repos/arjun-rao/clasp/contents/{+path}","compare_url":"https://api.github.com/repos/arjun-rao/clasp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arjun-rao/clasp/merges","archive_url":"https://api.github.com/repos/arjun-rao/clasp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arjun-rao/clasp/downloads","issues_url":"https://api.github.com/repos/arjun-rao/clasp/issues{/number}","pulls_url":"https://api.github.com/repos/arjun-rao/clasp/pulls{/number}","milestones_url":"https://api.github.com/repos/arjun-rao/clasp/milestones{/number}","notifications_url":"https://api.github.com/repos/arjun-rao/clasp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arjun-rao/clasp/labels{/name}","releases_url":"https://api.github.com/repos/arjun-rao/clasp/releases{/id}","deployments_url":"https://api.github.com/repos/arjun-rao/clasp/deployments","created_at":"2018-02-21T18:55:37Z","updated_at":"2018-02-21T18:55:39Z","pushed_at":"2018-04-05T16:17:10Z","git_url":"git://github.com/arjun-rao/clasp.git","ssh_url":"git@github.com:arjun-rao/clasp.git","clone_url":"https://github.com/arjun-rao/clasp.git","svn_url":"https://github.com/arjun-rao/clasp","homepage":"developers.google.com/apps-script/guides/clasp","size":127,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"google:master","ref":"master","sha":"ef0c310eccad0be607bfa786d0e0536400ee4c7d","user":{"login":"google","id":1342004,"avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":113111403,"name":"clasp","full_name":"google/clasp","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/clasp","description":"🔗 Develop Apps Script projects locally.","fork":false,"url":"https://api.github.com/repos/google/clasp","forks_url":"https://api.github.com/repos/google/clasp/forks","keys_url":"https://api.github.com/repos/google/clasp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/clasp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/clasp/teams","hooks_url":"https://api.github.com/repos/google/clasp/hooks","issue_events_url":"https://api.github.com/repos/google/clasp/issues/events{/number}","events_url":"https://api.github.com/repos/google/clasp/events","assignees_url":"https://api.github.com/repos/google/clasp/assignees{/user}","branches_url":"https://api.github.com/repos/google/clasp/branches{/branch}","tags_url":"https://api.github.com/repos/google/clasp/tags","blobs_url":"https://api.github.com/repos/google/clasp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/clasp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/clasp/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/clasp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/clasp/statuses/{sha}","languages_url":"https://api.github.com/repos/google/clasp/languages","stargazers_url":"https://api.github.com/repos/google/clasp/stargazers","contributors_url":"https://api.github.com/repos/google/clasp/contributors","subscribers_url":"https://api.github.com/repos/google/clasp/subscribers","subscription_url":"https://api.github.com/repos/google/clasp/subscription","commits_url":"https://api.github.com/repos/google/clasp/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/clasp/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/clasp/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/clasp/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/clasp/contents/{+path}","compare_url":"https://api.github.com/repos/google/clasp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/clasp/merges","archive_url":"https://api.github.com/repos/google/clasp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/clasp/downloads","issues_url":"https://api.github.com/repos/google/clasp/issues{/number}","pulls_url":"https://api.github.com/repos/google/clasp/pulls{/number}","milestones_url":"https://api.github.com/repos/google/clasp/milestones{/number}","notifications_url":"https://api.github.com/repos/google/clasp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/clasp/labels{/name}","releases_url":"https://api.github.com/repos/google/clasp/releases{/id}","deployments_url":"https://api.github.com/repos/google/clasp/deployments","created_at":"2017-12-05T00:34:56Z","updated_at":"2018-04-05T09:54:10Z","pushed_at":"2018-04-05T16:20:19Z","git_url":"git://github.com/google/clasp.git","ssh_url":"git@github.com:google/clasp.git","clone_url":"https://github.com/google/clasp.git","svn_url":"https://github.com/google/clasp","homepage":"https://developers.google.com/apps-script/guides/clasp","size":146,"stargazers_count":267,"watchers_count":267,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":31,"mirror_url":null,"archived":false,"open_issues_count":28,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":31,"open_issues":28,"watchers":267,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/clasp/pulls/96"},"html":{"href":"https://github.com/google/clasp/pull/96"},"issue":{"href":"https://api.github.com/repos/google/clasp/issues/96"},"comments":{"href":"https://api.github.com/repos/google/clasp/issues/96/comments"},"review_comments":{"href":"https://api.github.com/repos/google/clasp/pulls/96/comments"},"review_comment":{"href":"https://api.github.com/repos/google/clasp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/clasp/pulls/96/commits"},"statuses":{"href":"https://api.github.com/repos/google/clasp/statuses/0ef3ce6f30ccadb434d8cd669170b889b987631c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"grant"}}