From 0537d952b24f8c83c5e816241fae43b9e880f585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 16 Sep 2012 18:04:41 +0200 Subject: [PATCH] respect output directory --- doku.php | 9 +++++++-- moin2doku.py | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/doku.php b/doku.php index 41ae830..7e360b9 100755 --- a/doku.php +++ b/doku.php @@ -17,12 +17,17 @@ require_once DOKU_INC.'inc/init.php'; require_once DOKU_INC.'inc/common.php'; require_once DOKU_INC.'inc/cliopts.php'; +function strip_datadir($fn) { + global $conf; + return end(explode($conf['datadir'].'/', $fn, 2)); +} + switch ($argv[1]) { case 'cleanID': echo cleanID($argv[2]); break; -case 'wikiFn': - echo wikiFn($argv[2]); +case 'wikiFN': + echo strip_datadir(wikiFN($argv[2])); break; case 'mediaFn': echo mediaFn($argv[2]); diff --git a/moin2doku.py b/moin2doku.py index 4e3fb59..98d20b6 100755 --- a/moin2doku.py +++ b/moin2doku.py @@ -217,7 +217,7 @@ def convertfile(pagedir, overwrite = False): content = readfile(curr_rev) content = convert_markup(pagename, content) - out_file = dw.wikiFn(pagename) + out_file = os.path.join(output_dir, dw.wikiFN(pagename)) print "dokuname: [%s]" % out_file writefile(out_file, content, overwrite = overwrite)