X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FOyster.git;a=blobdiff_plain;f=lib%2FOyster%2FDeploy%2FGit.pm;h=c70eb8e35347aa71171b245c283d91d0baa2410c;hp=12e4ba0fa9ff6df370522b7c7a49d8734fde287e;hb=c0ce95cc18f039ddbd57762ffe7e0581f9ecfcad;hpb=d29be7cc660c7296580fe9a26ab081bc454bad82 diff --git a/lib/Oyster/Deploy/Git.pm b/lib/Oyster/Deploy/Git.pm index 12e4ba0..c70eb8e 100644 --- a/lib/Oyster/Deploy/Git.pm +++ b/lib/Oyster/Deploy/Git.pm @@ -11,17 +11,17 @@ use File::ShareDir ':ALL'; sub create { my $self = shift; my $location = shift; - + if( -f $location || -d $location ) { Error::Simple->throw("$location already exists"); } - + mkdir($location); my $git = Git::Wrapper->new($location); $git->init(); - + my ($postreceive, $postupdate); - + eval { $postreceive = dist_file( 'Oyster', './deploy/git/post-receive'); $postupdate = dist_file( 'Oyster', './deploy/git/post-update'); @@ -35,12 +35,12 @@ sub create { copy($postreceive, ($git->dir . '/.git/hooks/')) or Error::Simple->throw('Creating post commit hooks failed.'); - + copy($postupdate, ($git->dir . '/.git/hooks/')) or Error::Simple->throw('Creating post commit hooks failed.'); - + chmod(0x755, ($git->dir . '.git/hooks/post-receive', $git->dir . '.git/hooks/post-update')); - + return 1; }