{"action":"created","comment":{"url":"https://api.github.com/repos/aliyun/fun/pulls/comments/236592501","pull_request_review_id":178695242,"id":236592501,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjU5MjUwMQ==","diff_hunk":"@@ -0,0 +1,57 @@\n+#!/usr/bin/env node\n+\n+/* eslint-disable quotes */\n+\n+'use strict';\n+\n+const program = require('commander');\n+\n+const parseVars = (val, vars) => {\n+  const group = val.match(/(^[a-zA-Z$_][a-zA-Z\\d_]*)=(.*)/);\n+  vars = vars || {};\n+  if (group) {\n+    vars[group[1]] = group[2];\n+  }\n+  return vars;\n+};\n+\n+program\n+  .name('init')\n+  .usage('[options] [location]')\n+  .description('Initializes a new fun project')\n+  .option('-o, --output-dir [outputDir]', 'where to output the initialized app into', '.')\n+  .option('-n, --name [name]', 'name of your project to be generated as a folder', 'fun-app')\n+  .option('-i, --no-input [noInput]', 'disable prompting and accept default values defined template config', false)\n+  .option('-V, --var [vars]', 'template variable', parseVars)\n+  .on('--help', () => {\n+    console.log('');\n+    console.log('  Examples:');\n+    console.log('');\n+    console.log('    $ fun init');\n+    console.log('    $ fun init helloworld-nodejs8');\n+    console.log('    $ fun init foo/bar');\n+    console.log('    $ fun init gh:foo/bar');\n+    console.log('    $ fun init gl:foo/bar');\n+    console.log('    $ fun init bb:foo/bar');\n+    console.log('    $ fun init git+ssh://git@github.com/foo/bar.git');\n+    console.log('    $ fun init hg+ssh://hg@bitbucket.org/bar/foo');\n+    console.log('    $ fun init git@github.com/foo/bar.git');\n+    console.log('    $ fun init hg@bitbucket.org/bar/foo');\n+    console.log('    $ fun init https://github.com/foo/bar.git');\n+    console.log('    $ fun init /path/foo/bar');\n+    console.log('    $ fun init -n fun-app -V foo=bar /path/foo/bar');","path":"bin/fun-init.js","position":42,"original_position":42,"commit_id":"12cc591d9b91a67e63f1718f318513c671ab567b","original_commit_id":"12cc591d9b91a67e63f1718f318513c671ab567b","user":{"login":"muxiangqiu","id":11471925,"node_id":"MDQ6VXNlcjExNDcxOTI1","avatar_url":"https://avatars2.githubusercontent.com/u/11471925?v=4","gravatar_id":"","url":"https://api.github.com/users/muxiangqiu","html_url":"https://github.com/muxiangqiu","followers_url":"https://api.github.com/users/muxiangqiu/followers","following_url":"https://api.github.com/users/muxiangqiu/following{/other_user}","gists_url":"https://api.github.com/users/muxiangqiu/gists{/gist_id}","starred_url":"https://api.github.com/users/muxiangqiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muxiangqiu/subscriptions","organizations_url":"https://api.github.com/users/muxiangqiu/orgs","repos_url":"https://api.github.com/users/muxiangqiu/repos","events_url":"https://api.github.com/users/muxiangqiu/events{/privacy}","received_events_url":"https://api.github.com/users/muxiangqiu/received_events","type":"User","site_admin":false},"body":"我上面贴的其实就是 nodejs 多行文本的写法","created_at":"2018-11-27T10:02:49Z","updated_at":"2018-11-27T10:02:49Z","html_url":"https://github.com/aliyun/fun/pull/96#discussion_r236592501","pull_request_url":"https://api.github.com/repos/aliyun/fun/pulls/96","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/aliyun/fun/pulls/comments/236592501"},"html":{"href":"https://github.com/aliyun/fun/pull/96#discussion_r236592501"},"pull_request":{"href":"https://api.github.com/repos/aliyun/fun/pulls/96"}},"in_reply_to_id":236560071},"pull_request":{"url":"https://api.github.com/repos/aliyun/fun/pulls/96","id":233559870,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzNTU5ODcw","html_url":"https://github.com/aliyun/fun/pull/96","diff_url":"https://github.com/aliyun/fun/pull/96.diff","patch_url":"https://github.com/aliyun/fun/pull/96.patch","issue_url":"https://api.github.com/repos/aliyun/fun/issues/96","number":96,"state":"open","locked":false,"title":"add fun init","user":{"login":"muxiangqiu","id":11471925,"node_id":"MDQ6VXNlcjExNDcxOTI1","avatar_url":"https://avatars2.githubusercontent.com/u/11471925?v=4","gravatar_id":"","url":"https://api.github.com/users/muxiangqiu","html_url":"https://github.com/muxiangqiu","followers_url":"https://api.github.com/users/muxiangqiu/followers","following_url":"https://api.github.com/users/muxiangqiu/following{/other_user}","gists_url":"https://api.github.com/users/muxiangqiu/gists{/gist_id}","starred_url":"https://api.github.com/users/muxiangqiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muxiangqiu/subscriptions","organizations_url":"https://api.github.com/users/muxiangqiu/orgs","repos_url":"https://api.github.com/users/muxiangqiu/repos","events_url":"https://api.github.com/users/muxiangqiu/events{/privacy}","received_events_url":"https://api.github.com/users/muxiangqiu/received_events","type":"User","site_admin":false},"body":"Add `fun init [options] [location] ` command:\r\n\r\nUsage: init [options] [location]\r\n\r\n  Initializes a new fun project\r\n\r\n  Options:\r\n\r\n    -o, --output-dir [outputDir]  where to output the initialized app into (default: .)\r\n    -n, --name [name]             name of your project to be generated as a folder (default: fun-app)\r\n    -i, --no-input [noInput]      disable prompting and accept default values defined template config\r\n    -V, --var [vars]              template variable\r\n    -h, --help                    output usage information\r\n\r\n  Examples:\r\n\r\n    $ fun init\r\n    $ fun init helloworld-nodejs8\r\n    $ fun init foo/bar\r\n    $ fun init gh:foo/bar\r\n    $ fun init gl:foo/bar\r\n    $ fun init bb:foo/bar\r\n    $ fun init git+ssh://git@github.com/foo/bar.git\r\n    $ fun init hg+ssh://hg@bitbucket.org/bar/foo\r\n    $ fun init git@github.com/foo/bar.git\r\n    $ fun init hg@bitbucket.org/bar/foo\r\n    $ fun init https://github.com/foo/bar.git\r\n    $ fun init /path/foo/bar\r\n    $ fun init -n fun-app -V foo=bar /path/foo/bar","created_at":"2018-11-26T13:36:09Z","updated_at":"2018-11-27T10:02:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"24e23aa45f6841ced634e0f8a64362cd93b72137","assignee":null,"assignees":[],"requested_reviewers":[{"login":"JacksonTian","id":327019,"node_id":"MDQ6VXNlcjMyNzAxOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/327019?v=4","gravatar_id":"","url":"https://api.github.com/users/JacksonTian","html_url":"https://github.com/JacksonTian","followers_url":"https://api.github.com/users/JacksonTian/followers","following_url":"https://api.github.com/users/JacksonTian/following{/other_user}","gists_url":"https://api.github.com/users/JacksonTian/gists{/gist_id}","starred_url":"https://api.github.com/users/JacksonTian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JacksonTian/subscriptions","organizations_url":"https://api.github.com/users/JacksonTian/orgs","repos_url":"https://api.github.com/users/JacksonTian/repos","events_url":"https://api.github.com/users/JacksonTian/events{/privacy}","received_events_url":"https://api.github.com/users/JacksonTian/received_events","type":"User","site_admin":false},{"login":"feil0n9wan9","id":691845,"node_id":"MDQ6VXNlcjY5MTg0NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/691845?v=4","gravatar_id":"","url":"https://api.github.com/users/feil0n9wan9","html_url":"https://github.com/feil0n9wan9","followers_url":"https://api.github.com/users/feil0n9wan9/followers","following_url":"https://api.github.com/users/feil0n9wan9/following{/other_user}","gists_url":"https://api.github.com/users/feil0n9wan9/gists{/gist_id}","starred_url":"https://api.github.com/users/feil0n9wan9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feil0n9wan9/subscriptions","organizations_url":"https://api.github.com/users/feil0n9wan9/orgs","repos_url":"https://api.github.com/users/feil0n9wan9/repos","events_url":"https://api.github.com/users/feil0n9wan9/events{/privacy}","received_events_url":"https://api.github.com/users/feil0n9wan9/received_events","type":"User","site_admin":false},{"login":"tanhe123","id":4676235,"node_id":"MDQ6VXNlcjQ2NzYyMzU=","avatar_url":"https://avatars3.githubusercontent.com/u/4676235?v=4","gravatar_id":"","url":"https://api.github.com/users/tanhe123","html_url":"https://github.com/tanhe123","followers_url":"https://api.github.com/users/tanhe123/followers","following_url":"https://api.github.com/users/tanhe123/following{/other_user}","gists_url":"https://api.github.com/users/tanhe123/gists{/gist_id}","starred_url":"https://api.github.com/users/tanhe123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tanhe123/subscriptions","organizations_url":"https://api.github.com/users/tanhe123/orgs","repos_url":"https://api.github.com/users/tanhe123/repos","events_url":"https://api.github.com/users/tanhe123/events{/privacy}","received_events_url":"https://api.github.com/users/tanhe123/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/aliyun/fun/pulls/96/commits","review_comments_url":"https://api.github.com/repos/aliyun/fun/pulls/96/comments","review_comment_url":"https://api.github.com/repos/aliyun/fun/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aliyun/fun/issues/96/comments","statuses_url":"https://api.github.com/repos/aliyun/fun/statuses/12cc591d9b91a67e63f1718f318513c671ab567b","head":{"label":"muxiangqiu:kevin/add-fun-init","ref":"kevin/add-fun-init","sha":"12cc591d9b91a67e63f1718f318513c671ab567b","user":{"login":"muxiangqiu","id":11471925,"node_id":"MDQ6VXNlcjExNDcxOTI1","avatar_url":"https://avatars2.githubusercontent.com/u/11471925?v=4","gravatar_id":"","url":"https://api.github.com/users/muxiangqiu","html_url":"https://github.com/muxiangqiu","followers_url":"https://api.github.com/users/muxiangqiu/followers","following_url":"https://api.github.com/users/muxiangqiu/following{/other_user}","gists_url":"https://api.github.com/users/muxiangqiu/gists{/gist_id}","starred_url":"https://api.github.com/users/muxiangqiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muxiangqiu/subscriptions","organizations_url":"https://api.github.com/users/muxiangqiu/orgs","repos_url":"https://api.github.com/users/muxiangqiu/repos","events_url":"https://api.github.com/users/muxiangqiu/events{/privacy}","received_events_url":"https://api.github.com/users/muxiangqiu/received_events","type":"User","site_admin":false},"repo":{"id":157354571,"node_id":"MDEwOlJlcG9zaXRvcnkxNTczNTQ1NzE=","name":"fun","full_name":"muxiangqiu/fun","private":false,"owner":{"login":"muxiangqiu","id":11471925,"node_id":"MDQ6VXNlcjExNDcxOTI1","avatar_url":"https://avatars2.githubusercontent.com/u/11471925?v=4","gravatar_id":"","url":"https://api.github.com/users/muxiangqiu","html_url":"https://github.com/muxiangqiu","followers_url":"https://api.github.com/users/muxiangqiu/followers","following_url":"https://api.github.com/users/muxiangqiu/following{/other_user}","gists_url":"https://api.github.com/users/muxiangqiu/gists{/gist_id}","starred_url":"https://api.github.com/users/muxiangqiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muxiangqiu/subscriptions","organizations_url":"https://api.github.com/users/muxiangqiu/orgs","repos_url":"https://api.github.com/users/muxiangqiu/repos","events_url":"https://api.github.com/users/muxiangqiu/events{/privacy}","received_events_url":"https://api.github.com/users/muxiangqiu/received_events","type":"User","site_admin":false},"html_url":"https://github.com/muxiangqiu/fun","description":"(have) Fun with Serverless(API Gateway & Function Compute)","fork":true,"url":"https://api.github.com/repos/muxiangqiu/fun","forks_url":"https://api.github.com/repos/muxiangqiu/fun/forks","keys_url":"https://api.github.com/repos/muxiangqiu/fun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/muxiangqiu/fun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/muxiangqiu/fun/teams","hooks_url":"https://api.github.com/repos/muxiangqiu/fun/hooks","issue_events_url":"https://api.github.com/repos/muxiangqiu/fun/issues/events{/number}","events_url":"https://api.github.com/repos/muxiangqiu/fun/events","assignees_url":"https://api.github.com/repos/muxiangqiu/fun/assignees{/user}","branches_url":"https://api.github.com/repos/muxiangqiu/fun/branches{/branch}","tags_url":"https://api.github.com/repos/muxiangqiu/fun/tags","blobs_url":"https://api.github.com/repos/muxiangqiu/fun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/muxiangqiu/fun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/muxiangqiu/fun/git/refs{/sha}","trees_url":"https://api.github.com/repos/muxiangqiu/fun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/muxiangqiu/fun/statuses/{sha}","languages_url":"https://api.github.com/repos/muxiangqiu/fun/languages","stargazers_url":"https://api.github.com/repos/muxiangqiu/fun/stargazers","contributors_url":"https://api.github.com/repos/muxiangqiu/fun/contributors","subscribers_url":"https://api.github.com/repos/muxiangqiu/fun/subscribers","subscription_url":"https://api.github.com/repos/muxiangqiu/fun/subscription","commits_url":"https://api.github.com/repos/muxiangqiu/fun/commits{/sha}","git_commits_url":"https://api.github.com/repos/muxiangqiu/fun/git/commits{/sha}","comments_url":"https://api.github.com/repos/muxiangqiu/fun/comments{/number}","issue_comment_url":"https://api.github.com/repos/muxiangqiu/fun/issues/comments{/number}","contents_url":"https://api.github.com/repos/muxiangqiu/fun/contents/{+path}","compare_url":"https://api.github.com/repos/muxiangqiu/fun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/muxiangqiu/fun/merges","archive_url":"https://api.github.com/repos/muxiangqiu/fun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/muxiangqiu/fun/downloads","issues_url":"https://api.github.com/repos/muxiangqiu/fun/issues{/number}","pulls_url":"https://api.github.com/repos/muxiangqiu/fun/pulls{/number}","milestones_url":"https://api.github.com/repos/muxiangqiu/fun/milestones{/number}","notifications_url":"https://api.github.com/repos/muxiangqiu/fun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/muxiangqiu/fun/labels{/name}","releases_url":"https://api.github.com/repos/muxiangqiu/fun/releases{/id}","deployments_url":"https://api.github.com/repos/muxiangqiu/fun/deployments","created_at":"2018-11-13T09:30:53Z","updated_at":"2018-11-13T09:30:56Z","pushed_at":"2018-11-27T06:41:29Z","git_url":"git://github.com/muxiangqiu/fun.git","ssh_url":"git@github.com:muxiangqiu/fun.git","clone_url":"https://github.com/muxiangqiu/fun.git","svn_url":"https://github.com/muxiangqiu/fun","homepage":"","size":655,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"aliyun:master","ref":"master","sha":"877bdd27d1deead09445dafe46d9262986861f38","user":{"login":"aliyun","id":941070,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0MTA3MA==","avatar_url":"https://avatars3.githubusercontent.com/u/941070?v=4","gravatar_id":"","url":"https://api.github.com/users/aliyun","html_url":"https://github.com/aliyun","followers_url":"https://api.github.com/users/aliyun/followers","following_url":"https://api.github.com/users/aliyun/following{/other_user}","gists_url":"https://api.github.com/users/aliyun/gists{/gist_id}","starred_url":"https://api.github.com/users/aliyun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aliyun/subscriptions","organizations_url":"https://api.github.com/users/aliyun/orgs","repos_url":"https://api.github.com/users/aliyun/repos","events_url":"https://api.github.com/users/aliyun/events{/privacy}","received_events_url":"https://api.github.com/users/aliyun/received_events","type":"Organization","site_admin":false},"repo":{"id":98859345,"node_id":"MDEwOlJlcG9zaXRvcnk5ODg1OTM0NQ==","name":"fun","full_name":"aliyun/fun","private":false,"owner":{"login":"aliyun","id":941070,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0MTA3MA==","avatar_url":"https://avatars3.githubusercontent.com/u/941070?v=4","gravatar_id":"","url":"https://api.github.com/users/aliyun","html_url":"https://github.com/aliyun","followers_url":"https://api.github.com/users/aliyun/followers","following_url":"https://api.github.com/users/aliyun/following{/other_user}","gists_url":"https://api.github.com/users/aliyun/gists{/gist_id}","starred_url":"https://api.github.com/users/aliyun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aliyun/subscriptions","organizations_url":"https://api.github.com/users/aliyun/orgs","repos_url":"https://api.github.com/users/aliyun/repos","events_url":"https://api.github.com/users/aliyun/events{/privacy}","received_events_url":"https://api.github.com/users/aliyun/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/aliyun/fun","description":"(have) Fun with Serverless(API Gateway & Function Compute)","fork":false,"url":"https://api.github.com/repos/aliyun/fun","forks_url":"https://api.github.com/repos/aliyun/fun/forks","keys_url":"https://api.github.com/repos/aliyun/fun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aliyun/fun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aliyun/fun/teams","hooks_url":"https://api.github.com/repos/aliyun/fun/hooks","issue_events_url":"https://api.github.com/repos/aliyun/fun/issues/events{/number}","events_url":"https://api.github.com/repos/aliyun/fun/events","assignees_url":"https://api.github.com/repos/aliyun/fun/assignees{/user}","branches_url":"https://api.github.com/repos/aliyun/fun/branches{/branch}","tags_url":"https://api.github.com/repos/aliyun/fun/tags","blobs_url":"https://api.github.com/repos/aliyun/fun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aliyun/fun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aliyun/fun/git/refs{/sha}","trees_url":"https://api.github.com/repos/aliyun/fun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aliyun/fun/statuses/{sha}","languages_url":"https://api.github.com/repos/aliyun/fun/languages","stargazers_url":"https://api.github.com/repos/aliyun/fun/stargazers","contributors_url":"https://api.github.com/repos/aliyun/fun/contributors","subscribers_url":"https://api.github.com/repos/aliyun/fun/subscribers","subscription_url":"https://api.github.com/repos/aliyun/fun/subscription","commits_url":"https://api.github.com/repos/aliyun/fun/commits{/sha}","git_commits_url":"https://api.github.com/repos/aliyun/fun/git/commits{/sha}","comments_url":"https://api.github.com/repos/aliyun/fun/comments{/number}","issue_comment_url":"https://api.github.com/repos/aliyun/fun/issues/comments{/number}","contents_url":"https://api.github.com/repos/aliyun/fun/contents/{+path}","compare_url":"https://api.github.com/repos/aliyun/fun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aliyun/fun/merges","archive_url":"https://api.github.com/repos/aliyun/fun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aliyun/fun/downloads","issues_url":"https://api.github.com/repos/aliyun/fun/issues{/number}","pulls_url":"https://api.github.com/repos/aliyun/fun/pulls{/number}","milestones_url":"https://api.github.com/repos/aliyun/fun/milestones{/number}","notifications_url":"https://api.github.com/repos/aliyun/fun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aliyun/fun/labels{/name}","releases_url":"https://api.github.com/repos/aliyun/fun/releases{/id}","deployments_url":"https://api.github.com/repos/aliyun/fun/deployments","created_at":"2017-07-31T07:12:41Z","updated_at":"2018-11-27T08:14:19Z","pushed_at":"2018-11-27T06:41:30Z","git_url":"git://github.com/aliyun/fun.git","ssh_url":"git@github.com:aliyun/fun.git","clone_url":"https://github.com/aliyun/fun.git","svn_url":"https://github.com/aliyun/fun","homepage":"","size":700,"stargazers_count":107,"watchers_count":107,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":16,"open_issues":15,"watchers":107,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aliyun/fun/pulls/96"},"html":{"href":"https://github.com/aliyun/fun/pull/96"},"issue":{"href":"https://api.github.com/repos/aliyun/fun/issues/96"},"comments":{"href":"https://api.github.com/repos/aliyun/fun/issues/96/comments"},"review_comments":{"href":"https://api.github.com/repos/aliyun/fun/pulls/96/comments"},"review_comment":{"href":"https://api.github.com/repos/aliyun/fun/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aliyun/fun/pulls/96/commits"},"statuses":{"href":"https://api.github.com/repos/aliyun/fun/statuses/12cc591d9b91a67e63f1718f318513c671ab567b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"muxiangqiu"}}