{"action":"created","comment":{"url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/pulls/comments/68825031","id":68825031,"diff_hunk":"@@ -77,20 +83,89 @@\n \n $recipefile = $options['recipe'];\n \n-// Expanding '~' on Unix-like OS'es.\n-if ($recipefile[0] === '~') {\n-    $homedir = getenv('HOME');\n-    $recipefile = $homedir.substr($recipefile, 1);\n-}\n-\n-$recipefile = realpath($recipefile);\n+$recipefile = expand_path($recipefile);\n if ($recipefile === false) {\n     echo(\"\\nInvalid recipe file!\\n\");\n     echo $help;\n     die();\n }\n \n-$loglevels = Logger::getLevels();\n+if (!is_readable($recipefile)) {\n+    echo(\"\\nRecipe file not readable!\\n\");\n+    echo $help;\n+    die();\n+}\n+\n+// Load the recipe from file.\n+$recipe = yaml::decode_file($recipefile);\n+\n+if (!empty($options['target-dir']) && !empty($options['target-moodle'])) {\n+    echo(\"\\nSpecify one of 'target-dir' or 'target-moodle'!\\n\");\n+    echo $help;\n+    die();\n+}\n+\n+if (!empty($options['target-dir'])) {\n+\n+    $targetdir = $options['target-dir'];\n+    $targetdir = expand_path($targetdir);\n+    if ($targetdir === false) {\n+        echo(\"\\nInvalid target directory!\\n\");\n+        echo $help;\n+        die();\n+    }\n+\n+    if (!is_writable($targetdir)) {\n+        echo(\"\\nTarget plugin location is not writable!\\n\");\n+        echo $help;\n+        die();\n+    }\n+\n+    list($type, $name) = \\core_component::normalize_component($recipe['component']);\n+    $targetdir = $targetdir.'/'.$name;\n+\n+} else {\n+\n+    if (empty($options['target-moodle'])) {\n+        $targetdir = $CFG->dirroot;\n+    } else {\n+\n+        print(\"here\\n\");","path":"cli/generate.php","position":101,"original_position":101,"commit_id":"27a78e2f69bd3073991f1b71751b93e0f2b2d833","original_commit_id":"27a78e2f69bd3073991f1b71751b93e0f2b2d833","user":{"login":"alexandru-elisei","id":9026580,"avatar_url":"https://avatars.githubusercontent.com/u/9026580?v=3","gravatar_id":"","url":"https://api.github.com/users/alexandru-elisei","html_url":"https://github.com/alexandru-elisei","followers_url":"https://api.github.com/users/alexandru-elisei/followers","following_url":"https://api.github.com/users/alexandru-elisei/following{/other_user}","gists_url":"https://api.github.com/users/alexandru-elisei/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandru-elisei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandru-elisei/subscriptions","organizations_url":"https://api.github.com/users/alexandru-elisei/orgs","repos_url":"https://api.github.com/users/alexandru-elisei/repos","events_url":"https://api.github.com/users/alexandru-elisei/events{/privacy}","received_events_url":"https://api.github.com/users/alexandru-elisei/received_events","type":"User","site_admin":false},"body":"Relic of debugging, it slipped by me. Deleting it.","created_at":"2016-06-28T19:23:21Z","updated_at":"2016-06-28T19:23:21Z","html_url":"https://github.com/mudrd8mz/moodle-tool_pluginskel/pull/32#discussion_r68825031","pull_request_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/pulls/32","_links":{"self":{"href":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/pulls/comments/68825031"},"html":{"href":"https://github.com/mudrd8mz/moodle-tool_pluginskel/pull/32#discussion_r68825031"},"pull_request":{"href":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/pulls/32"}}},"pull_request":{"url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/pulls/32","id":75454065,"html_url":"https://github.com/mudrd8mz/moodle-tool_pluginskel/pull/32","diff_url":"https://github.com/mudrd8mz/moodle-tool_pluginskel/pull/32.diff","patch_url":"https://github.com/mudrd8mz/moodle-tool_pluginskel/pull/32.patch","issue_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/issues/32","number":32,"state":"open","locked":false,"title":"Display log levels and write the files to the target directory","user":{"login":"alexandru-elisei","id":9026580,"avatar_url":"https://avatars.githubusercontent.com/u/9026580?v=3","gravatar_id":"","url":"https://api.github.com/users/alexandru-elisei","html_url":"https://github.com/alexandru-elisei","followers_url":"https://api.github.com/users/alexandru-elisei/followers","following_url":"https://api.github.com/users/alexandru-elisei/following{/other_user}","gists_url":"https://api.github.com/users/alexandru-elisei/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandru-elisei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandru-elisei/subscriptions","organizations_url":"https://api.github.com/users/alexandru-elisei/orgs","repos_url":"https://api.github.com/users/alexandru-elisei/repos","events_url":"https://api.github.com/users/alexandru-elisei/events{/privacy}","received_events_url":"https://api.github.com/users/alexandru-elisei/received_events","type":"User","site_admin":false},"body":"Per #23","created_at":"2016-06-28T10:31:17Z","updated_at":"2016-06-28T19:23:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ce53fd6040a791ae8f185fab4cf2112222001b8d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/pulls/32/commits","review_comments_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/pulls/32/comments","review_comment_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/issues/32/comments","statuses_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/statuses/27a78e2f69bd3073991f1b71751b93e0f2b2d833","head":{"label":"alexandru-elisei:cli_script_patch","ref":"cli_script_patch","sha":"27a78e2f69bd3073991f1b71751b93e0f2b2d833","user":{"login":"alexandru-elisei","id":9026580,"avatar_url":"https://avatars.githubusercontent.com/u/9026580?v=3","gravatar_id":"","url":"https://api.github.com/users/alexandru-elisei","html_url":"https://github.com/alexandru-elisei","followers_url":"https://api.github.com/users/alexandru-elisei/followers","following_url":"https://api.github.com/users/alexandru-elisei/following{/other_user}","gists_url":"https://api.github.com/users/alexandru-elisei/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandru-elisei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandru-elisei/subscriptions","organizations_url":"https://api.github.com/users/alexandru-elisei/orgs","repos_url":"https://api.github.com/users/alexandru-elisei/repos","events_url":"https://api.github.com/users/alexandru-elisei/events{/privacy}","received_events_url":"https://api.github.com/users/alexandru-elisei/received_events","type":"User","site_admin":false},"repo":{"id":61717429,"name":"moodle-tool_pluginskel","full_name":"alexandru-elisei/moodle-tool_pluginskel","owner":{"login":"alexandru-elisei","id":9026580,"avatar_url":"https://avatars.githubusercontent.com/u/9026580?v=3","gravatar_id":"","url":"https://api.github.com/users/alexandru-elisei","html_url":"https://github.com/alexandru-elisei","followers_url":"https://api.github.com/users/alexandru-elisei/followers","following_url":"https://api.github.com/users/alexandru-elisei/following{/other_user}","gists_url":"https://api.github.com/users/alexandru-elisei/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandru-elisei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandru-elisei/subscriptions","organizations_url":"https://api.github.com/users/alexandru-elisei/orgs","repos_url":"https://api.github.com/users/alexandru-elisei/repos","events_url":"https://api.github.com/users/alexandru-elisei/events{/privacy}","received_events_url":"https://api.github.com/users/alexandru-elisei/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexandru-elisei/moodle-tool_pluginskel","description":"Generator of Moodle plugins skeletons","fork":true,"url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel","forks_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/forks","keys_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/teams","hooks_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/hooks","issue_events_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/issues/events{/number}","events_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/events","assignees_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/assignees{/user}","branches_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/branches{/branch}","tags_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/tags","blobs_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/statuses/{sha}","languages_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/languages","stargazers_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/stargazers","contributors_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/contributors","subscribers_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/subscribers","subscription_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/subscription","commits_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/contents/{+path}","compare_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/merges","archive_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/downloads","issues_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/issues{/number}","pulls_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/pulls{/number}","milestones_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/milestones{/number}","notifications_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/labels{/name}","releases_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/releases{/id}","deployments_url":"https://api.github.com/repos/alexandru-elisei/moodle-tool_pluginskel/deployments","created_at":"2016-06-22T12:30:38Z","updated_at":"2016-06-22T12:30:39Z","pushed_at":"2016-06-28T14:27:10Z","git_url":"git://github.com/alexandru-elisei/moodle-tool_pluginskel.git","ssh_url":"git@github.com:alexandru-elisei/moodle-tool_pluginskel.git","clone_url":"https://github.com/alexandru-elisei/moodle-tool_pluginskel.git","svn_url":"https://github.com/alexandru-elisei/moodle-tool_pluginskel","homepage":null,"size":295,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mudrd8mz:master","ref":"master","sha":"4f6a6c4d2c65812b070ea9dc5a0037a5df81365a","user":{"login":"mudrd8mz","id":85831,"avatar_url":"https://avatars.githubusercontent.com/u/85831?v=3","gravatar_id":"","url":"https://api.github.com/users/mudrd8mz","html_url":"https://github.com/mudrd8mz","followers_url":"https://api.github.com/users/mudrd8mz/followers","following_url":"https://api.github.com/users/mudrd8mz/following{/other_user}","gists_url":"https://api.github.com/users/mudrd8mz/gists{/gist_id}","starred_url":"https://api.github.com/users/mudrd8mz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mudrd8mz/subscriptions","organizations_url":"https://api.github.com/users/mudrd8mz/orgs","repos_url":"https://api.github.com/users/mudrd8mz/repos","events_url":"https://api.github.com/users/mudrd8mz/events{/privacy}","received_events_url":"https://api.github.com/users/mudrd8mz/received_events","type":"User","site_admin":false},"repo":{"id":61660195,"name":"moodle-tool_pluginskel","full_name":"mudrd8mz/moodle-tool_pluginskel","owner":{"login":"mudrd8mz","id":85831,"avatar_url":"https://avatars.githubusercontent.com/u/85831?v=3","gravatar_id":"","url":"https://api.github.com/users/mudrd8mz","html_url":"https://github.com/mudrd8mz","followers_url":"https://api.github.com/users/mudrd8mz/followers","following_url":"https://api.github.com/users/mudrd8mz/following{/other_user}","gists_url":"https://api.github.com/users/mudrd8mz/gists{/gist_id}","starred_url":"https://api.github.com/users/mudrd8mz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mudrd8mz/subscriptions","organizations_url":"https://api.github.com/users/mudrd8mz/orgs","repos_url":"https://api.github.com/users/mudrd8mz/repos","events_url":"https://api.github.com/users/mudrd8mz/events{/privacy}","received_events_url":"https://api.github.com/users/mudrd8mz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mudrd8mz/moodle-tool_pluginskel","description":"Generator of Moodle plugins skeletons","fork":false,"url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel","forks_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/forks","keys_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/teams","hooks_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/hooks","issue_events_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/issues/events{/number}","events_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/events","assignees_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/assignees{/user}","branches_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/branches{/branch}","tags_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/tags","blobs_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/git/refs{/sha}","trees_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/statuses/{sha}","languages_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/languages","stargazers_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/stargazers","contributors_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/contributors","subscribers_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/subscribers","subscription_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/subscription","commits_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/commits{/sha}","git_commits_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/git/commits{/sha}","comments_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/comments{/number}","issue_comment_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/issues/comments{/number}","contents_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/contents/{+path}","compare_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/merges","archive_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/downloads","issues_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/issues{/number}","pulls_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/pulls{/number}","milestones_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/milestones{/number}","notifications_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/labels{/name}","releases_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/releases{/id}","deployments_url":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/deployments","created_at":"2016-06-21T19:11:58Z","updated_at":"2016-06-21T19:12:30Z","pushed_at":"2016-06-28T19:11:22Z","git_url":"git://github.com/mudrd8mz/moodle-tool_pluginskel.git","ssh_url":"git@github.com:mudrd8mz/moodle-tool_pluginskel.git","clone_url":"https://github.com/mudrd8mz/moodle-tool_pluginskel.git","svn_url":"https://github.com/mudrd8mz/moodle-tool_pluginskel","homepage":null,"size":291,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":13,"forks":1,"open_issues":13,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/pulls/32"},"html":{"href":"https://github.com/mudrd8mz/moodle-tool_pluginskel/pull/32"},"issue":{"href":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/issues/32"},"comments":{"href":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/mudrd8mz/moodle-tool_pluginskel/statuses/27a78e2f69bd3073991f1b71751b93e0f2b2d833"}}}}
{"actor":{"display_login":"alexandru-elisei"}}