{"action":"created","comment":{"url":"https://api.github.com/repos/kabisa/maji/pulls/comments/165919856","pull_request_review_id":93928065,"id":165919856,"diff_hunk":"@@ -0,0 +1,48 @@\n+const spawn = require(\"cross-spawn\");\n+const path = require(\"path\");\n+\n+module.exports.runCordova = (args, envArgs = {}) => {\n+  const cordovaCli = path.join(\n+    process.cwd(),\n+    \"node_modules\",\n+    \".bin\",\n+    \"cordova\"\n+  );\n+  const cordovaDir = path.join(process.cwd(), \"cordova\");\n+\n+  return runCmd(cordovaCli, args, envArgs, { cwd: cordovaDir });\n+};\n+\n+module.exports.runYarn = (args, envArgs = {}) => {\n+  return runCmd(\"yarn\", [\"--silent\", ...Array.from(args)], envArgs);\n+};\n+\n+const runCmd = (cmd, args, envArgs = {}, spawnArgs = {}) => {\n+  if (process.env.TRACE) {\n+    console.log(\n+      `Executing ${cmd} (${args}) (${JSON.stringify(\n+        envArgs\n+      )}) (${JSON.stringify(spawnArgs)})`\n+    );\n+  }\n+\n+  return new Promise((resolve, reject) => {\n+    let env = Object.create(process.env);\n+    Object.assign(env, envArgs);\n+\n+    let child = spawn(cmd, args, { env, stdio: \"inherit\", ...spawnArgs });\n+\n+    if (child.stdout != null) {\n+      child.stdout.on(\"data\", data => process.stdout.write(data));","path":"src/utils.js","position":36,"original_position":36,"commit_id":"c223d037e2c87e5d61d3278ecbeb3b8e6cff3dd3","original_commit_id":"c223d037e2c87e5d61d3278ecbeb3b8e6cff3dd3","user":{"login":"pascalw","id":304603,"avatar_url":"https://avatars0.githubusercontent.com/u/304603?v=4","gravatar_id":"","url":"https://api.github.com/users/pascalw","html_url":"https://github.com/pascalw","followers_url":"https://api.github.com/users/pascalw/followers","following_url":"https://api.github.com/users/pascalw/following{/other_user}","gists_url":"https://api.github.com/users/pascalw/gists{/gist_id}","starred_url":"https://api.github.com/users/pascalw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pascalw/subscriptions","organizations_url":"https://api.github.com/users/pascalw/orgs","repos_url":"https://api.github.com/users/pascalw/repos","events_url":"https://api.github.com/users/pascalw/events{/privacy}","received_events_url":"https://api.github.com/users/pascalw/received_events","type":"User","site_admin":false},"body":"Could well be, I just moved this code over from the previous implementation. Actually we might as well use spawnSync with `stdio: inherit` as async is not important here anyway.","created_at":"2018-02-05T09:38:35Z","updated_at":"2018-02-05T09:38:35Z","html_url":"https://github.com/kabisa/maji/pull/218#discussion_r165919856","pull_request_url":"https://api.github.com/repos/kabisa/maji/pulls/218","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/kabisa/maji/pulls/comments/165919856"},"html":{"href":"https://github.com/kabisa/maji/pull/218#discussion_r165919856"},"pull_request":{"href":"https://api.github.com/repos/kabisa/maji/pulls/218"}},"in_reply_to_id":165903539},"pull_request":{"url":"https://api.github.com/repos/kabisa/maji/pulls/218","id":166827060,"html_url":"https://github.com/kabisa/maji/pull/218","diff_url":"https://github.com/kabisa/maji/pull/218.diff","patch_url":"https://github.com/kabisa/maji/pull/218.patch","issue_url":"https://api.github.com/repos/kabisa/maji/issues/218","number":218,"state":"open","locked":false,"title":"Replace bash scripting with Javascript","user":{"login":"pascalw","id":304603,"avatar_url":"https://avatars0.githubusercontent.com/u/304603?v=4","gravatar_id":"","url":"https://api.github.com/users/pascalw","html_url":"https://github.com/pascalw","followers_url":"https://api.github.com/users/pascalw/followers","following_url":"https://api.github.com/users/pascalw/following{/other_user}","gists_url":"https://api.github.com/users/pascalw/gists{/gist_id}","starred_url":"https://api.github.com/users/pascalw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pascalw/subscriptions","organizations_url":"https://api.github.com/users/pascalw/orgs","repos_url":"https://api.github.com/users/pascalw/repos","events_url":"https://api.github.com/users/pascalw/events{/privacy}","received_events_url":"https://api.github.com/users/pascalw/received_events","type":"User","site_admin":false},"body":"This PR replaces all bash scripting with pure Javascript. Main advantage is that this improves compatibility with Windows and in general it's nicer if everything is written in Javascript.\r\n\r\nA couple of other notable changes that I made in the process:\r\n\r\n* Moved new project creation to a separate package, `create-maji-app`.\r\n  * This has the advantage of being able to use the `yarn create` workflow, e.g. `yarn create maji-app com.example.myapp ~/Code/myapp`.\r\n  * It also keeps the dependencies of the main package lighter.\r\n* Use an embedded [Yeoman](http://yeoman.io/) generator to create the project.\r\n  * This makes it easier in the future to ask questions during project creation, for example 'Typescript or Javascript?`.\r\n  * Yeoman generators can be ran on existing projects. This makes it easier to update existing projects with new template changes.\r\n* Use [Husky](https://github.com/typicode/husky) and [lint-staged](https://github.com/okonet/lint-staged) for Git hooks.\r\n  * Our previous Git hooks were using a lot Unix tools and thus are not ideal for Windows. Husky requires `/bin/sh` but from what I read Git installations on Windows usually include this. See https://github.com/typicode/husky/issues/228 for details.","created_at":"2018-02-02T15:16:11Z","updated_at":"2018-02-05T09:38:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c52b20acf63258a60830f39d7a5f7dd51607c80f","assignee":null,"assignees":[],"requested_reviewers":[{"login":"matthijsgroen","id":23627,"avatar_url":"https://avatars2.githubusercontent.com/u/23627?v=4","gravatar_id":"","url":"https://api.github.com/users/matthijsgroen","html_url":"https://github.com/matthijsgroen","followers_url":"https://api.github.com/users/matthijsgroen/followers","following_url":"https://api.github.com/users/matthijsgroen/following{/other_user}","gists_url":"https://api.github.com/users/matthijsgroen/gists{/gist_id}","starred_url":"https://api.github.com/users/matthijsgroen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthijsgroen/subscriptions","organizations_url":"https://api.github.com/users/matthijsgroen/orgs","repos_url":"https://api.github.com/users/matthijsgroen/repos","events_url":"https://api.github.com/users/matthijsgroen/events{/privacy}","received_events_url":"https://api.github.com/users/matthijsgroen/received_events","type":"User","site_admin":false}],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/kabisa/maji/pulls/218/commits","review_comments_url":"https://api.github.com/repos/kabisa/maji/pulls/218/comments","review_comment_url":"https://api.github.com/repos/kabisa/maji/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kabisa/maji/issues/218/comments","statuses_url":"https://api.github.com/repos/kabisa/maji/statuses/c223d037e2c87e5d61d3278ecbeb3b8e6cff3dd3","head":{"label":"kabisa:feature/pure-js","ref":"feature/pure-js","sha":"c223d037e2c87e5d61d3278ecbeb3b8e6cff3dd3","user":{"login":"kabisa","id":1531725,"avatar_url":"https://avatars1.githubusercontent.com/u/1531725?v=4","gravatar_id":"","url":"https://api.github.com/users/kabisa","html_url":"https://github.com/kabisa","followers_url":"https://api.github.com/users/kabisa/followers","following_url":"https://api.github.com/users/kabisa/following{/other_user}","gists_url":"https://api.github.com/users/kabisa/gists{/gist_id}","starred_url":"https://api.github.com/users/kabisa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kabisa/subscriptions","organizations_url":"https://api.github.com/users/kabisa/orgs","repos_url":"https://api.github.com/users/kabisa/repos","events_url":"https://api.github.com/users/kabisa/events{/privacy}","received_events_url":"https://api.github.com/users/kabisa/received_events","type":"Organization","site_admin":false},"repo":{"id":31175060,"name":"maji","full_name":"kabisa/maji","owner":{"login":"kabisa","id":1531725,"avatar_url":"https://avatars1.githubusercontent.com/u/1531725?v=4","gravatar_id":"","url":"https://api.github.com/users/kabisa","html_url":"https://github.com/kabisa","followers_url":"https://api.github.com/users/kabisa/followers","following_url":"https://api.github.com/users/kabisa/following{/other_user}","gists_url":"https://api.github.com/users/kabisa/gists{/gist_id}","starred_url":"https://api.github.com/users/kabisa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kabisa/subscriptions","organizations_url":"https://api.github.com/users/kabisa/orgs","repos_url":"https://api.github.com/users/kabisa/repos","events_url":"https://api.github.com/users/kabisa/events{/privacy}","received_events_url":"https://api.github.com/users/kabisa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kabisa/maji","description":"Maji is a framework to build great hybrid mobile apps. http://majimobile.com/","fork":false,"url":"https://api.github.com/repos/kabisa/maji","forks_url":"https://api.github.com/repos/kabisa/maji/forks","keys_url":"https://api.github.com/repos/kabisa/maji/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kabisa/maji/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kabisa/maji/teams","hooks_url":"https://api.github.com/repos/kabisa/maji/hooks","issue_events_url":"https://api.github.com/repos/kabisa/maji/issues/events{/number}","events_url":"https://api.github.com/repos/kabisa/maji/events","assignees_url":"https://api.github.com/repos/kabisa/maji/assignees{/user}","branches_url":"https://api.github.com/repos/kabisa/maji/branches{/branch}","tags_url":"https://api.github.com/repos/kabisa/maji/tags","blobs_url":"https://api.github.com/repos/kabisa/maji/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kabisa/maji/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kabisa/maji/git/refs{/sha}","trees_url":"https://api.github.com/repos/kabisa/maji/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kabisa/maji/statuses/{sha}","languages_url":"https://api.github.com/repos/kabisa/maji/languages","stargazers_url":"https://api.github.com/repos/kabisa/maji/stargazers","contributors_url":"https://api.github.com/repos/kabisa/maji/contributors","subscribers_url":"https://api.github.com/repos/kabisa/maji/subscribers","subscription_url":"https://api.github.com/repos/kabisa/maji/subscription","commits_url":"https://api.github.com/repos/kabisa/maji/commits{/sha}","git_commits_url":"https://api.github.com/repos/kabisa/maji/git/commits{/sha}","comments_url":"https://api.github.com/repos/kabisa/maji/comments{/number}","issue_comment_url":"https://api.github.com/repos/kabisa/maji/issues/comments{/number}","contents_url":"https://api.github.com/repos/kabisa/maji/contents/{+path}","compare_url":"https://api.github.com/repos/kabisa/maji/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kabisa/maji/merges","archive_url":"https://api.github.com/repos/kabisa/maji/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kabisa/maji/downloads","issues_url":"https://api.github.com/repos/kabisa/maji/issues{/number}","pulls_url":"https://api.github.com/repos/kabisa/maji/pulls{/number}","milestones_url":"https://api.github.com/repos/kabisa/maji/milestones{/number}","notifications_url":"https://api.github.com/repos/kabisa/maji/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kabisa/maji/labels{/name}","releases_url":"https://api.github.com/repos/kabisa/maji/releases{/id}","deployments_url":"https://api.github.com/repos/kabisa/maji/deployments","created_at":"2015-02-22T18:58:44Z","updated_at":"2018-02-02T19:12:04Z","pushed_at":"2018-02-04T17:07:44Z","git_url":"git://github.com/kabisa/maji.git","ssh_url":"git@github.com:kabisa/maji.git","clone_url":"https://github.com/kabisa/maji.git","svn_url":"https://github.com/kabisa/maji","homepage":"","size":908,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":4,"open_issues":12,"watchers":8,"default_branch":"master"}},"base":{"label":"kabisa:master","ref":"master","sha":"b506e1dc9060cdd221ff9ae3c38fecc9f96a3dc7","user":{"login":"kabisa","id":1531725,"avatar_url":"https://avatars1.githubusercontent.com/u/1531725?v=4","gravatar_id":"","url":"https://api.github.com/users/kabisa","html_url":"https://github.com/kabisa","followers_url":"https://api.github.com/users/kabisa/followers","following_url":"https://api.github.com/users/kabisa/following{/other_user}","gists_url":"https://api.github.com/users/kabisa/gists{/gist_id}","starred_url":"https://api.github.com/users/kabisa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kabisa/subscriptions","organizations_url":"https://api.github.com/users/kabisa/orgs","repos_url":"https://api.github.com/users/kabisa/repos","events_url":"https://api.github.com/users/kabisa/events{/privacy}","received_events_url":"https://api.github.com/users/kabisa/received_events","type":"Organization","site_admin":false},"repo":{"id":31175060,"name":"maji","full_name":"kabisa/maji","owner":{"login":"kabisa","id":1531725,"avatar_url":"https://avatars1.githubusercontent.com/u/1531725?v=4","gravatar_id":"","url":"https://api.github.com/users/kabisa","html_url":"https://github.com/kabisa","followers_url":"https://api.github.com/users/kabisa/followers","following_url":"https://api.github.com/users/kabisa/following{/other_user}","gists_url":"https://api.github.com/users/kabisa/gists{/gist_id}","starred_url":"https://api.github.com/users/kabisa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kabisa/subscriptions","organizations_url":"https://api.github.com/users/kabisa/orgs","repos_url":"https://api.github.com/users/kabisa/repos","events_url":"https://api.github.com/users/kabisa/events{/privacy}","received_events_url":"https://api.github.com/users/kabisa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kabisa/maji","description":"Maji is a framework to build great hybrid mobile apps. http://majimobile.com/","fork":false,"url":"https://api.github.com/repos/kabisa/maji","forks_url":"https://api.github.com/repos/kabisa/maji/forks","keys_url":"https://api.github.com/repos/kabisa/maji/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kabisa/maji/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kabisa/maji/teams","hooks_url":"https://api.github.com/repos/kabisa/maji/hooks","issue_events_url":"https://api.github.com/repos/kabisa/maji/issues/events{/number}","events_url":"https://api.github.com/repos/kabisa/maji/events","assignees_url":"https://api.github.com/repos/kabisa/maji/assignees{/user}","branches_url":"https://api.github.com/repos/kabisa/maji/branches{/branch}","tags_url":"https://api.github.com/repos/kabisa/maji/tags","blobs_url":"https://api.github.com/repos/kabisa/maji/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kabisa/maji/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kabisa/maji/git/refs{/sha}","trees_url":"https://api.github.com/repos/kabisa/maji/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kabisa/maji/statuses/{sha}","languages_url":"https://api.github.com/repos/kabisa/maji/languages","stargazers_url":"https://api.github.com/repos/kabisa/maji/stargazers","contributors_url":"https://api.github.com/repos/kabisa/maji/contributors","subscribers_url":"https://api.github.com/repos/kabisa/maji/subscribers","subscription_url":"https://api.github.com/repos/kabisa/maji/subscription","commits_url":"https://api.github.com/repos/kabisa/maji/commits{/sha}","git_commits_url":"https://api.github.com/repos/kabisa/maji/git/commits{/sha}","comments_url":"https://api.github.com/repos/kabisa/maji/comments{/number}","issue_comment_url":"https://api.github.com/repos/kabisa/maji/issues/comments{/number}","contents_url":"https://api.github.com/repos/kabisa/maji/contents/{+path}","compare_url":"https://api.github.com/repos/kabisa/maji/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kabisa/maji/merges","archive_url":"https://api.github.com/repos/kabisa/maji/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kabisa/maji/downloads","issues_url":"https://api.github.com/repos/kabisa/maji/issues{/number}","pulls_url":"https://api.github.com/repos/kabisa/maji/pulls{/number}","milestones_url":"https://api.github.com/repos/kabisa/maji/milestones{/number}","notifications_url":"https://api.github.com/repos/kabisa/maji/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kabisa/maji/labels{/name}","releases_url":"https://api.github.com/repos/kabisa/maji/releases{/id}","deployments_url":"https://api.github.com/repos/kabisa/maji/deployments","created_at":"2015-02-22T18:58:44Z","updated_at":"2018-02-02T19:12:04Z","pushed_at":"2018-02-04T17:07:44Z","git_url":"git://github.com/kabisa/maji.git","ssh_url":"git@github.com:kabisa/maji.git","clone_url":"https://github.com/kabisa/maji.git","svn_url":"https://github.com/kabisa/maji","homepage":"","size":908,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":4,"open_issues":12,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kabisa/maji/pulls/218"},"html":{"href":"https://github.com/kabisa/maji/pull/218"},"issue":{"href":"https://api.github.com/repos/kabisa/maji/issues/218"},"comments":{"href":"https://api.github.com/repos/kabisa/maji/issues/218/comments"},"review_comments":{"href":"https://api.github.com/repos/kabisa/maji/pulls/218/comments"},"review_comment":{"href":"https://api.github.com/repos/kabisa/maji/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kabisa/maji/pulls/218/commits"},"statuses":{"href":"https://api.github.com/repos/kabisa/maji/statuses/c223d037e2c87e5d61d3278ecbeb3b8e6cff3dd3"}},"author_association":"OWNER"}}
{"actor":{"display_login":"pascalw"}}