Added script for creating repository on remote server.
[prj-utils.git] / prj-create-repo.pl
1 #!/usr/bin/env perl
2
3 use strict;
4 use warnings;
5 use Config::General;
6 use Net::SSH::Perl;
7
8 # prj-create-repo.pl "login@host" "path/project.git"
9
10 my ($login, $host) = split(/@/, shift);
11 my $path = shift;
12
13 print "Logging to $host...\n";
14 my $ssh = Net::SSH::Perl->new($host, debug => 0);
15 $ssh->login($login, "");
16
17 print "Creating remote Git Repository...\n";
18 my ($stdout, $stderr, $exit) = $ssh->cmd("mkdir $path && cd $path && git init --bare");
19 print $stdout;