{"action":"created","comment":{"url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/pulls/comments/25092062","id":25092062,"diff_hunk":"@@ -43,14 +44,19 @@ Command.prototype.execute = function() {\n \tif(deleteDirectory){\n \t\t$tw.utils.deleteDirectory(pathname);\n \t}\n-\t$tw.utils.createDirectory(pathname);\n \t$tw.utils.each(tiddlers,function(title) {\n \t\tvar parser = wiki.parseTiddler(template),\n \t\t\twidgetNode = wiki.makeWidget(parser,{variables: {currentTiddler: title}});\n \t\tvar container = $tw.fakeDocument.createElement(\"div\");\n \t\twidgetNode.render(container,null);\n \t\tvar text = type === \"text/html\" ? container.innerHTML : container.textContent;\n-\t\tfs.writeFileSync(path.resolve(pathname,encodeURIComponent(title) + extension),text,\"utf8\");\n+\t\tvar export_path = null;\n+\t\tif($tw.utils.hop($tw.macros,\"tv-get-export-path\")) {\n+\t\t\texport_path = $tw.macros[\"tv-get-export-path\"].run.apply(self,[title]);\n+\t\t}\t\t\n+\t\tvar final_path = path.resolve(outputPath,(export_path || encodeURIComponent(title)) + extension);","path":"core/modules/commands/rendertiddlers.js","position":26,"original_position":26,"commit_id":"d1809f352c372daa22b4c587416369145a74d01d","original_commit_id":"d1809f352c372daa22b4c587416369145a74d01d","user":{"login":"Jermolene","id":174761,"avatar_url":"https://avatars.githubusercontent.com/u/174761?v=3","gravatar_id":"","url":"https://api.github.com/users/Jermolene","html_url":"https://github.com/Jermolene","followers_url":"https://api.github.com/users/Jermolene/followers","following_url":"https://api.github.com/users/Jermolene/following{/other_user}","gists_url":"https://api.github.com/users/Jermolene/gists{/gist_id}","starred_url":"https://api.github.com/users/Jermolene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jermolene/subscriptions","organizations_url":"https://api.github.com/users/Jermolene/orgs","repos_url":"https://api.github.com/users/Jermolene/repos","events_url":"https://api.github.com/users/Jermolene/events{/privacy}","received_events_url":"https://api.github.com/users/Jermolene/received_events","type":"User","site_admin":false},"body":"Is the problem that here you should be referencing `pathname` instead of `outputPath`?","created_at":"2015-02-20T18:44:46Z","updated_at":"2015-02-20T18:44:46Z","html_url":"https://github.com/Jermolene/TiddlyWiki5/pull/1509#discussion_r25092062","pull_request_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/pulls/1509","_links":{"self":{"href":"https://api.github.com/repos/Jermolene/TiddlyWiki5/pulls/comments/25092062"},"html":{"href":"https://github.com/Jermolene/TiddlyWiki5/pull/1509#discussion_r25092062"},"pull_request":{"href":"https://api.github.com/repos/Jermolene/TiddlyWiki5/pulls/1509"}}},"pull_request":{"url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/pulls/1509","id":29322010,"html_url":"https://github.com/Jermolene/TiddlyWiki5/pull/1509","diff_url":"https://github.com/Jermolene/TiddlyWiki5/pull/1509.diff","patch_url":"https://github.com/Jermolene/TiddlyWiki5/pull/1509.patch","issue_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/issues/1509","number":1509,"state":"closed","locked":false,"title":"Static export macro for custom paths","user":{"login":"welford","id":4590399,"avatar_url":"https://avatars.githubusercontent.com/u/4590399?v=3","gravatar_id":"","url":"https://api.github.com/users/welford","html_url":"https://github.com/welford","followers_url":"https://api.github.com/users/welford/followers","following_url":"https://api.github.com/users/welford/following{/other_user}","gists_url":"https://api.github.com/users/welford/gists{/gist_id}","starred_url":"https://api.github.com/users/welford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/welford/subscriptions","organizations_url":"https://api.github.com/users/welford/orgs","repos_url":"https://api.github.com/users/welford/repos","events_url":"https://api.github.com/users/welford/events{/privacy}","received_events_url":"https://api.github.com/users/welford/received_events","type":"User","site_admin":false},"body":"See #1381 for original pull request. ","created_at":"2015-02-14T16:19:11Z","updated_at":"2015-02-20T18:44:47Z","closed_at":"2015-02-20T18:15:43Z","merged_at":"2015-02-20T18:15:43Z","merge_commit_sha":"827455210fcb0f2d8122339dc1dd803f79168097","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/pulls/1509/commits","review_comments_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/pulls/1509/comments","review_comment_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/issues/1509/comments","statuses_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/statuses/d1809f352c372daa22b4c587416369145a74d01d","head":{"label":"welford:static_export_macro","ref":"static_export_macro","sha":"d1809f352c372daa22b4c587416369145a74d01d","user":{"login":"welford","id":4590399,"avatar_url":"https://avatars.githubusercontent.com/u/4590399?v=3","gravatar_id":"","url":"https://api.github.com/users/welford","html_url":"https://github.com/welford","followers_url":"https://api.github.com/users/welford/followers","following_url":"https://api.github.com/users/welford/following{/other_user}","gists_url":"https://api.github.com/users/welford/gists{/gist_id}","starred_url":"https://api.github.com/users/welford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/welford/subscriptions","organizations_url":"https://api.github.com/users/welford/orgs","repos_url":"https://api.github.com/users/welford/repos","events_url":"https://api.github.com/users/welford/events{/privacy}","received_events_url":"https://api.github.com/users/welford/received_events","type":"User","site_admin":false},"repo":{"id":26783231,"name":"TiddlyWiki5","full_name":"welford/TiddlyWiki5","owner":{"login":"welford","id":4590399,"avatar_url":"https://avatars.githubusercontent.com/u/4590399?v=3","gravatar_id":"","url":"https://api.github.com/users/welford","html_url":"https://github.com/welford","followers_url":"https://api.github.com/users/welford/followers","following_url":"https://api.github.com/users/welford/following{/other_user}","gists_url":"https://api.github.com/users/welford/gists{/gist_id}","starred_url":"https://api.github.com/users/welford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/welford/subscriptions","organizations_url":"https://api.github.com/users/welford/orgs","repos_url":"https://api.github.com/users/welford/repos","events_url":"https://api.github.com/users/welford/events{/privacy}","received_events_url":"https://api.github.com/users/welford/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/welford/TiddlyWiki5","description":"A reboot of TiddlyWiki for the next 25 years","fork":true,"url":"https://api.github.com/repos/welford/TiddlyWiki5","forks_url":"https://api.github.com/repos/welford/TiddlyWiki5/forks","keys_url":"https://api.github.com/repos/welford/TiddlyWiki5/keys{/key_id}","collaborators_url":"https://api.github.com/repos/welford/TiddlyWiki5/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/welford/TiddlyWiki5/teams","hooks_url":"https://api.github.com/repos/welford/TiddlyWiki5/hooks","issue_events_url":"https://api.github.com/repos/welford/TiddlyWiki5/issues/events{/number}","events_url":"https://api.github.com/repos/welford/TiddlyWiki5/events","assignees_url":"https://api.github.com/repos/welford/TiddlyWiki5/assignees{/user}","branches_url":"https://api.github.com/repos/welford/TiddlyWiki5/branches{/branch}","tags_url":"https://api.github.com/repos/welford/TiddlyWiki5/tags","blobs_url":"https://api.github.com/repos/welford/TiddlyWiki5/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/welford/TiddlyWiki5/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/welford/TiddlyWiki5/git/refs{/sha}","trees_url":"https://api.github.com/repos/welford/TiddlyWiki5/git/trees{/sha}","statuses_url":"https://api.github.com/repos/welford/TiddlyWiki5/statuses/{sha}","languages_url":"https://api.github.com/repos/welford/TiddlyWiki5/languages","stargazers_url":"https://api.github.com/repos/welford/TiddlyWiki5/stargazers","contributors_url":"https://api.github.com/repos/welford/TiddlyWiki5/contributors","subscribers_url":"https://api.github.com/repos/welford/TiddlyWiki5/subscribers","subscription_url":"https://api.github.com/repos/welford/TiddlyWiki5/subscription","commits_url":"https://api.github.com/repos/welford/TiddlyWiki5/commits{/sha}","git_commits_url":"https://api.github.com/repos/welford/TiddlyWiki5/git/commits{/sha}","comments_url":"https://api.github.com/repos/welford/TiddlyWiki5/comments{/number}","issue_comment_url":"https://api.github.com/repos/welford/TiddlyWiki5/issues/comments/{number}","contents_url":"https://api.github.com/repos/welford/TiddlyWiki5/contents/{+path}","compare_url":"https://api.github.com/repos/welford/TiddlyWiki5/compare/{base}...{head}","merges_url":"https://api.github.com/repos/welford/TiddlyWiki5/merges","archive_url":"https://api.github.com/repos/welford/TiddlyWiki5/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/welford/TiddlyWiki5/downloads","issues_url":"https://api.github.com/repos/welford/TiddlyWiki5/issues{/number}","pulls_url":"https://api.github.com/repos/welford/TiddlyWiki5/pulls{/number}","milestones_url":"https://api.github.com/repos/welford/TiddlyWiki5/milestones{/number}","notifications_url":"https://api.github.com/repos/welford/TiddlyWiki5/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/welford/TiddlyWiki5/labels{/name}","releases_url":"https://api.github.com/repos/welford/TiddlyWiki5/releases{/id}","created_at":"2014-11-17T23:53:58Z","updated_at":"2015-02-14T16:02:17Z","pushed_at":"2015-02-16T22:11:11Z","git_url":"git://github.com/welford/TiddlyWiki5.git","ssh_url":"git@github.com:welford/TiddlyWiki5.git","clone_url":"https://github.com/welford/TiddlyWiki5.git","svn_url":"https://github.com/welford/TiddlyWiki5","homepage":"http://tiddlywiki.com/","size":20826,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"Jermolene:master","ref":"master","sha":"74f423af2a5beabd0ee9262f31d4e860bb8e547b","user":{"login":"Jermolene","id":174761,"avatar_url":"https://avatars.githubusercontent.com/u/174761?v=3","gravatar_id":"","url":"https://api.github.com/users/Jermolene","html_url":"https://github.com/Jermolene","followers_url":"https://api.github.com/users/Jermolene/followers","following_url":"https://api.github.com/users/Jermolene/following{/other_user}","gists_url":"https://api.github.com/users/Jermolene/gists{/gist_id}","starred_url":"https://api.github.com/users/Jermolene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jermolene/subscriptions","organizations_url":"https://api.github.com/users/Jermolene/orgs","repos_url":"https://api.github.com/users/Jermolene/repos","events_url":"https://api.github.com/users/Jermolene/events{/privacy}","received_events_url":"https://api.github.com/users/Jermolene/received_events","type":"User","site_admin":false},"repo":{"id":2828239,"name":"TiddlyWiki5","full_name":"Jermolene/TiddlyWiki5","owner":{"login":"Jermolene","id":174761,"avatar_url":"https://avatars.githubusercontent.com/u/174761?v=3","gravatar_id":"","url":"https://api.github.com/users/Jermolene","html_url":"https://github.com/Jermolene","followers_url":"https://api.github.com/users/Jermolene/followers","following_url":"https://api.github.com/users/Jermolene/following{/other_user}","gists_url":"https://api.github.com/users/Jermolene/gists{/gist_id}","starred_url":"https://api.github.com/users/Jermolene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jermolene/subscriptions","organizations_url":"https://api.github.com/users/Jermolene/orgs","repos_url":"https://api.github.com/users/Jermolene/repos","events_url":"https://api.github.com/users/Jermolene/events{/privacy}","received_events_url":"https://api.github.com/users/Jermolene/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Jermolene/TiddlyWiki5","description":"A reboot of TiddlyWiki for the next 25 years","fork":false,"url":"https://api.github.com/repos/Jermolene/TiddlyWiki5","forks_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/forks","keys_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/teams","hooks_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/hooks","issue_events_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/issues/events{/number}","events_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/events","assignees_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/assignees{/user}","branches_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/branches{/branch}","tags_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/tags","blobs_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/git/refs{/sha}","trees_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/statuses/{sha}","languages_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/languages","stargazers_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/stargazers","contributors_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/contributors","subscribers_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/subscribers","subscription_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/subscription","commits_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/commits{/sha}","git_commits_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/git/commits{/sha}","comments_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/comments{/number}","issue_comment_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/issues/comments/{number}","contents_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/contents/{+path}","compare_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/merges","archive_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/downloads","issues_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/issues{/number}","pulls_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/pulls{/number}","milestones_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/milestones{/number}","notifications_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/labels{/name}","releases_url":"https://api.github.com/repos/Jermolene/TiddlyWiki5/releases{/id}","created_at":"2011-11-22T14:26:07Z","updated_at":"2015-02-20T18:39:18Z","pushed_at":"2015-02-20T18:39:18Z","git_url":"git://github.com/Jermolene/TiddlyWiki5.git","ssh_url":"git@github.com:Jermolene/TiddlyWiki5.git","clone_url":"https://github.com/Jermolene/TiddlyWiki5.git","svn_url":"https://github.com/Jermolene/TiddlyWiki5","homepage":"http://tiddlywiki.com/","size":36006,"stargazers_count":1070,"watchers_count":1070,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":283,"mirror_url":null,"open_issues_count":322,"forks":283,"open_issues":322,"watchers":1070,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Jermolene/TiddlyWiki5/pulls/1509"},"html":{"href":"https://github.com/Jermolene/TiddlyWiki5/pull/1509"},"issue":{"href":"https://api.github.com/repos/Jermolene/TiddlyWiki5/issues/1509"},"comments":{"href":"https://api.github.com/repos/Jermolene/TiddlyWiki5/issues/1509/comments"},"review_comments":{"href":"https://api.github.com/repos/Jermolene/TiddlyWiki5/pulls/1509/comments"},"review_comment":{"href":"https://api.github.com/repos/Jermolene/TiddlyWiki5/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Jermolene/TiddlyWiki5/pulls/1509/commits"},"statuses":{"href":"https://api.github.com/repos/Jermolene/TiddlyWiki5/statuses/d1809f352c372daa22b4c587416369145a74d01d"}}}}