1 package Oyster::Deploy::Git;
9 use File::ShareDir ':ALL';
16 if( -f $location || -d $location ) {
17 Error::Simple->throw("$location already exists");
21 my $git = Git::Wrapper->new($location);
23 my $postreceive = module_file('Oyster::Deploy::Git', '../share/deploy/git/post-receive');
24 my $postupdate = module_file('Oyster::Deploy::Git', '../share/deploy/git/post-update');
26 copy($postreceive, ($git->dir . '.git/hooks/'))
27 or Error::Simple->throw('Creating post commit hooks failed.');
28 copy($postupdate, ($git->dir . '.git/hooks/'))
29 or Error::Simple->throw('Creating post commit hooks failed.');
31 chmod(0x755, ('./bin/git/hooks/post-receive', './bin/git/hooks/post-update'));