#! /usr/bin/perl
use strict;
use File::Copy;
my $web_dir = 'directory';
if (! -d 'directory.slb.com') {
mkdir("$web_dir", 0777);
}
# file list to be checked out from CVS
my @CVSfiles = qw(
development/web-files/help/file.xx
development/web-files/help/file2.xx
development/web-files/help/images/file.xx
development/web-files/help/images/file2.xx
development/web-files/help/change-process/file.xx
development/web-files/help/change-process/file2.xx
development/web-files/help/corporate-identity/file.xx
development/web-files/help/corporate-identity/file2.xx
development/web-files/help/example-clients/file.xx
development/web-files/help/example-clients/file2.xx
);
my $help;
my $images;
my $bulk_ops;
my $change_process;
my $corporate_identity;
my $example_clients;
my $pm_scripts;
my $cgi_scripts;
my $reports;
foreach my $files (@CVSfiles) {
if ($files =~ m/development\/web-files\/(help)\/.+/) { # set $help for directory creation if found
if ($1 =~ m/help/) {$help = "help"; }
}
if ($files =~ m/development\/web-files\/help\/(.+)\/.*/) { # set $help/sub_directory for directory creation if found
if ($1 =~ m/images/) {$images = "images"; }
if ($1 =~ m/bulk-ops/) {$bulk_ops = "bulk-ops"; }
if ($1 =~ m/change-process/) {$change_process = "change-process"; }
if ($1 =~ m/corporate-identity/) {$corporate_identity = "corporate-identity"; }
if ($1 =~ m/example-clients/) {$example_clients = "example-clients"; }
if ($1 =~ m/cgi-scripts/) {$cgi_scripts = "cgi-scripts"; }
if ($1 =~ m/reports/) {$reports = "reports"; }
}
}
## make sub directories if needed
if (($help) && (! -d "help")) {
mkdir("$web_dir/help", 0777);
}
if (($images) && (! -d "help/images")) {
mkdir("$web_dir/help/images", 0777);
}
if (($bulk_ops) && (! -d "help/bulk_ops")) {
mkdir("$web_dir/help/bulk_ops", 0777);
}
if (($change_process) && (! -d "help/change-process")) {
mkdir("$web_dir/help/change-process", 0777);
}
if (($corporate_identity) && (! -d "help/corporate-identity")) {
mkdir("$web_dir/help/corporate-identity", 0777);
}
if (($example_clients) && (! -d "help/example-clients")) {
mkdir("$web_dir/help/example-clients", 0777);
}
if (($cgi_scripts) && (! -d "help/cgi-scripts")) {
mkdir("$web_dir/help/cgi-scripts", 0777);
}
if (($reports) && (! -d "help/reports")) {
mkdir("$web_dir/help/reports", 0777);
}
|