2008-05-07 02:32:46 +04:00
|
|
|
#!/usr/bin/perl
|
|
|
|
|
|
|
|
##################################################################
|
|
|
|
# Arguments
|
|
|
|
##################################################################
|
|
|
|
|
|
|
|
$targetFolder = "deploy";
|
2008-12-09 04:44:01 +03:00
|
|
|
$suffix = "150b2";
|
2008-05-07 02:32:46 +04:00
|
|
|
|
|
|
|
##################################################################
|
|
|
|
# Copies tree into target folder, preprocess .phps
|
|
|
|
##################################################################
|
|
|
|
|
|
|
|
sub process_dir($$) {
|
|
|
|
my ($from,$to) = @_;
|
|
|
|
opendir(DIR, $from) || die "can't opendir $from: $!";
|
|
|
|
my @content = readdir(DIR);
|
|
|
|
closedir DIR;
|
|
|
|
mkdir $to;
|
|
|
|
|
2008-10-06 05:13:49 +04:00
|
|
|
for(grep { -f "$from/$_" && ($_ !~ /^\./ || $_ eq ".htaccess" || $_ eq ".keep") } @content) {
|
2008-05-07 02:32:46 +04:00
|
|
|
my ($source,$target) = ("$from/$_","$to/$_");
|
|
|
|
|
|
|
|
open (IN,"$source");
|
|
|
|
binmode(IN);
|
|
|
|
open (OUT,">$target");
|
|
|
|
binmode(OUT);
|
|
|
|
print OUT $buffer while (read (IN,$buffer,65536));
|
|
|
|
}
|
|
|
|
|
|
|
|
for(grep { -d "$from/$_" && $_ !~ /^\./ } @content) {
|
|
|
|
process_dir("$from/$_","$to/$_");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
##################################################################
|
|
|
|
# Main
|
|
|
|
##################################################################
|
|
|
|
|
|
|
|
die "Target folder exists: $targetFolder" if -e $targetFolder;
|
|
|
|
|
|
|
|
process_dir("./webim", $targetFolder);
|
|
|
|
|
|
|
|
chdir $targetFolder;
|
2008-10-03 17:49:45 +04:00
|
|
|
`zip -r ../webim$suffix.zip *`;
|