summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Process/HTMLify.pm
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-04-20 05:02:27 +0000
committerfukachan <fukachan>2002-04-20 05:02:27 +0000
commit632b9b6c786c9765c0487e2aabdc983fb5374ed2 (patch)
tree329d53d5b595f9f603a4a447799109bb63774812 /fml/lib/FML/Process/HTMLify.pm
parent06bf3832bc4100ac3fde6d01e988e21e644beeb9 (diff)
downloadfml8-632b9b6c786c9765c0487e2aabdc983fb5374ed2.tar.gz
fml8-632b9b6c786c9765c0487e2aabdc983fb5374ed2.tar.bz2
fml8-632b9b6c786c9765c0487e2aabdc983fb5374ed2.zip
use FML::Command::HTMLify to share htmlify code between fmlhtmlify and
"makefml htmlify".
Diffstat (limited to 'fml/lib/FML/Process/HTMLify.pm')
-rw-r--r--fml/lib/FML/Process/HTMLify.pm71
1 files changed, 7 insertions, 64 deletions
diff --git a/fml/lib/FML/Process/HTMLify.pm b/fml/lib/FML/Process/HTMLify.pm
index c275585b..a0b3286b 100644
--- a/fml/lib/FML/Process/HTMLify.pm
+++ b/fml/lib/FML/Process/HTMLify.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2001,2002 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: HTMLify.pm,v 1.16 2002/04/19 05:21:54 fukachan Exp $
+# $FML: HTMLify.pm,v 1.17 2002/04/20 04:25:22 fukachan Exp $
#
package FML::Process::HTMLify;
@@ -123,75 +123,18 @@ sub run
unshift(@INC, $options->{ I });
}
- unless (-d $src_dir) {
- croak("no such source directory");
- }
-
- my ($is_subdir_exists, $subdirs) = _check_subdir_exists($src_dir);
- if ($is_subdir_exists) { Log("looks subdir exists");}
-
- if (defined $dst_dir) {
- unless (-d $dst_dir) {
- use File::Utils qw(mkdirhier);
- mkdirhier($dst_dir, 0755);
- }
-
- if ($is_subdir_exists) {
- for my $xdir (@$subdirs) {
- eval q{
- use Mail::Message::ToHTML;
- &Mail::Message::ToHTML::htmlify_dir($xdir, {
- directory => $dst_dir,
- });
- };
- croak($@) if $@;
- }
- }
- else {
- eval q{
- use Mail::Message::ToHTML;
- &Mail::Message::ToHTML::htmlify_dir($src_dir, {
- directory => $dst_dir,
- });
- };
- croak($@) if $@;
- }
- }
- else {
- croak("no destination directory\n");
- }
+ # main converter
+ use FML::Command::HTMLify;
+ &FML::Command::HTMLify::convert($curproc, $args, {
+ src_dir => $src_dir,
+ dst_dir => $dst_dir,
+ });
$eval = $config->get_hook( 'fmlhtmlify_run_end_hook' );
if ($eval) { eval qq{ $eval; }; LogWarn($@) if $@; }
}
-sub _check_subdir_exists
-{
- my ($src_dir) = @_;
- my $status = 0;
- my $subdir = '';
- my @subdir = ();
-
- use File::Spec;
- use DirHandle;
- my $dh = new DirHandle $src_dir;
- if (defined $dh) {
- while (defined($_ = $dh->read)) {
- next if /^\./;
- $subdir = File::Spec->catfile($src_dir, $_);
-
- if (-d $subdir) {
- push(@subdir, $subdir);
- $status = 1;
- }
- }
- }
-
- return( $status, \@subdir );
-}
-
-
# Descriptions: show help
# Arguments: none
# Side Effects: none