Added script for creating repository on remote server.
authorRafał Długołęcki <kontakt@dlugolecki.net.pl>
Fri, 1 Mar 2013 09:38:19 +0000 (10:38 +0100)
committerRafał Długołęcki <kontakt@dlugolecki.net.pl>
Fri, 1 Mar 2013 09:38:19 +0000 (10:38 +0100)
prj-create-repo.pl [new file with mode: 0755]

diff --git a/prj-create-repo.pl b/prj-create-repo.pl
new file mode 100755 (executable)
index 0000000..bf083c1
--- /dev/null
@@ -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;