Changeset 3081 for trunk/gsdl/bin/script/convert_toc_dir.pl
- Timestamp:
- 2002-04-05T09:27:33+12:00 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/convert_toc_dir.pl
r2815 r3081 3 3 # run convert_toc.pl on any html files found in the directory passed in on 4 4 # the command line (or any subdirs). 5 6 die "\$GSDLOS not set !\n" if (!defined $ENV{GSDLOS}); 7 my ($move, $separator); 8 if ($ENV{GSDLOS} eq "windows") { 9 $move = "move"; 10 $separator = "\\"; 11 } else { 12 $move = "mv"; 13 $separator = "/"; 14 } 5 15 6 16 &recurse($ARGV[0]); … … 20 30 foreach my $file (@files) { 21 31 next if $file =~ /^\.\.?$/; 22 my $fullpath = "$dir /$file";32 my $fullpath = "$dir$separator$file"; 23 33 if (-d $fullpath) { 24 34 &recurse($fullpath); 25 35 } elsif ($file =~ /\.html?$/i) { 26 36 print STDERR "converting $fullpath\n"; 27 `convert_toc.pl < $fullpath >$fullpath.new`;28 ` mv$fullpath.new $fullpath`;37 `convert_toc.pl $fullpath $fullpath.new`; 38 `$move $fullpath.new $fullpath`; 29 39 } 30 40 }
Note:
See TracChangeset
for help on using the changeset viewer.