App-Followme
view release on metacpan or search on metacpan
script/followme view on Meta::CPAN
quick_update => $quick_update);
$app->run($directory);
}
#----------------------------------------------------------------------
# Construct configuration file name
sub configuration_file {
my @path = splitdir($0);
my $basename = pop(@path);
$basename .= '.cfg';
return $basename;
}
#----------------------------------------------------------------------
# Change directory to filename or directory containing filename if passed
sub set_directory {
my ($filename) = @_;
my $directory;
if (defined $filename) {
if (-d $filename) {
$directory = $filename;
} else {
my @path = splitdir($filename);
pop(@path);
$directory = catfile(@path) if @path;
}
}
$directory = getcwd();
die "Could not set directory: $!\n" unless $directory;
die "Could not change directory: $directory\n" unless chdir($directory);
return $directory;
}
#----------------------------------------------------------------------
# Set quick update mode
sub set_quick_update {
my ($filename) = @_;
my $quick_update = defined $filename && ! -d $filename;
return $quick_update;
}
#----------------------------------------------------------------------
# Print the help file
sub show_help {
print <<'EOQ';
Usage: followme [file or directory]
Update a static website after changes. Constant portions of each page are
updated to match, text files are converted to html, and indexes are created
for new files in the archive.
The script is run on the directory or file passed as its argument. If no
argument is given, it is run on the current directory.
If a file is passed, the script is run on the directory the file is in. In
addition, the script is run in quick mode, meaning that only the directory
the file is in is checked for changes. Otherwise not only that directory, but
all directories below it are checked.
Options:
-h --help print this help
-g --guide print the guide, a fuller explanation of the task
-i --init copy default templates and configurations to directory
EOQ
return;
}
__END__
=encoding utf-8
=head1 NAME
followme - Simple static website creation and maintenance
=head1 SYNOPSIS
followme [file or directory]
=head1 DESCRIPTION
Updates a static website after changes. Constant portions of each page are
updated to match, text files are converted to html, and indexes are created
for files in the archive.
The script is run on the directory or file passed as its argument. If no
argument is given, it is run on the current directory.
If a file is passed, the script is run on the directory the file is in. In
addition, the script is run in quick mode, meaning that only the directory
the file is in is checked for changes. Otherwise not only that directory, but
all directories below it are checked.
head1 LICENSE
Copyright (C) Bernie Simon.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=head1 AUTHOR
Bernie Simon E<lt>bernie.simon@gmail.comE<gt>
=cut
( run in 0.475 second using v1.01-cache-2.11-cpan-99c4e6809bf )