From: Rafał Długołęcki Date: Fri, 1 Mar 2013 09:38:19 +0000 (+0100) Subject: Added script for creating repository on remote server. X-Git-Tag: 0.1~6 X-Git-Url: https://git.dlugolecki.net.pl/?a=commitdiff_plain;h=58482f612c447c8d1991ab5b0857b4471b827f7f;p=prj-utils.git Added script for creating repository on remote server. --- diff --git a/prj-create-repo.pl b/prj-create-repo.pl new file mode 100755 index 0000000..bf083c1 --- /dev/null +++ b/prj-create-repo.pl @@ -0,0 +1,19 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use Config::General; +use Net::SSH::Perl; + +# prj-create-repo.pl "login@host" "path/project.git" + +my ($login, $host) = split(/@/, shift); +my $path = shift; + +print "Logging to $host...\n"; +my $ssh = Net::SSH::Perl->new($host, debug => 0); +$ssh->login($login, ""); + +print "Creating remote Git Repository...\n"; +my ($stdout, $stderr, $exit) = $ssh->cmd("mkdir $path && cd $path && git init --bare"); +print $stdout;