1 package Oyster::Deploy::Git;
9 use File::ShareDir ':ALL';
15 if( -f $location || -d $location ) {
16 Error::Simple->throw("$location already exists");
20 my $git = Git::Wrapper->new($location);
23 my ($postreceive, $postupdate);
26 $postreceive = dist_file( 'Oyster', './deploy/git/post-receive');
27 $postupdate = dist_file( 'Oyster', './deploy/git/post-update');
29 #Beware there be deamons here
31 $postreceive = './share/deploy/git/post-receive';
32 $postupdate = './share/deploy/git/post-update';
36 copy($postreceive, ($git->dir . '/.git/hooks/'))
37 or Error::Simple->throw('Creating post commit hooks failed.');
39 copy($postupdate, ($git->dir . '/.git/hooks/'))
40 or Error::Simple->throw('Creating post commit hooks failed.');
42 chmod(0x755, ($git->dir . '.git/hooks/post-receive', $git->dir . '.git/hooks/post-update'));