X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FOyster%2FDeploy%2FGit.pm;h=19e50701f6e892e01074fe669e02bd3476c9598c;hb=HEAD;hp=8f22d35151e707a13dd613f91add5448ba9f3872;hpb=73e49568c742446827513eab3e170b636c06b392;p=p5sagit%2FOyster.git diff --git a/lib/Oyster/Deploy/Git.pm b/lib/Oyster/Deploy/Git.pm index 8f22d35..19e5070 100644 --- a/lib/Oyster/Deploy/Git.pm +++ b/lib/Oyster/Deploy/Git.pm @@ -2,12 +2,13 @@ package Oyster::Deploy::Git; use strict; use warnings; -use Git::Wrapper; +#use Git::Wrapper; # sorry fails tests! +use Moose; our $post_receive = q{ #!/bin/sh cd .. -env -i git reset --hard HEAD +/usr/bin/git reset --hard HEAD dzil listdeps | xargs cpanm --local-lib=~/perl5 }; @@ -34,22 +35,23 @@ sub create { } mkdir($location); - my $git = Git::Wrapper->new($location); - $git->init(); + #my $git = Git::Wrapper->new($location); + #$git->init(); + qx{cd $location ; git init}; - open my $fh_post_receive, '>', $git->dir . '/.git/hooks/post-receive' - or die "Cannot write to " . $git->dir . '/.git/hooks/post-receive' . ": $!"; + open my $fh_post_receive, '>', "$location/.git/hooks/post-receive" + or die "Cannot write to " . "$location/.git/hooks/post-receive: $!"; print $fh_post_receive $post_receive; close $fh_post_receive - or die "Cannot close " . $git->dir . '/.git/hooks/post-receive' . ": $!"; + or die "Cannot close " . "$location/.git/hooks/post-receive: $!"; - open my $fh_post_update, '>', $git->dir . '/.git/hooks/post-update' - or die "Cannot write to " . $git->dir . '/.git/hooks/post-update' . ": $!"; + open my $fh_post_update, '>', "$location/.git/hooks/post-update" + or die "Cannot write to " . "$location/.git/hooks/post-update: $!"; print $fh_post_update $post_update; close $fh_post_update - or die "Cannot close " . $git->dir . '/.git/hooks/post-update' . ": $!"; + or die "Cannot close " . "$location/.git/hooks/post-update: $!"; - chmod(0x755, ($git->dir . '.git/hooks/post-receive', $git->dir . '.git/hooks/post-update')); + chmod(0x755, ("$location/.git/hooks/post-receive", "$location/.git/hooks/post-update")); return 1; }