commit - 1f2b28aab3ce59403d35f8ed056e6a02d6972225
commit + 88da003bb57c4fe23764101ecb9d776106a5c32b
blob - 30f9b58226f9e011b82831779ea5aefc47f56901
blob + 3206ccebed6c8fdfac26de40021b1bb7e45a7225
--- bin/configNow.pl
+++ bin/configNow.pl
use lib qw(./lib);
use IRCNOW::ConfigNow;
+use File::Basename;
+use File::Path qw(make_path);
+use Git::Repository;
+use Git::Repository::Command;
+
my $shellname = shift || 'bnsnet';
my $username = shift || 'izzyb';
-my $shellConfig = new IRCNOW::ConfigNow(
+my %config=(
type=>'shell',
shellname => $shellname,
username => $username,
+ configNow => './configNow',
ipv4 => '38.87.162.191',
ipv6 => '2602:fccf:1:1191::',
domain => 'user.planetofnix.com',
);
+my $shellConfig = new IRCNOW::ConfigNow( %config );
for my $module ($shellConfig->list()) {
for my $file ($shellConfig->list($module)) {
- print "$file: ".$shellConfig->filename($file) ."\n";
- print $shellConfig->output($file) . "\n";
+ my $filename = $shellConfig->filename($file);
+ my $path = dirname($filename);
+ print "Making Directory: $path\n";
+ make_path($path);
+ print "Writing: $filename\n";
+ open my $FH, ">>$filename";
+ print $FH $shellConfig->output($file);
+ close $FH;
}
}
+my $r = Git::Repository->new(work_tree => $config{configNow});
+
+my $cmd = Git::Repository::Command->new($r, [qw(status)]);
+$cmd->close();
+
+print $cmd->exit();
+
+
+
blob - beb64851249690758ad47ae26c308a43333b2075
blob + 0dcfca6d31b41f8534031d26c0fdb20ec5ada45c
--- lib/IRCNOW/ConfigNow.pm
+++ lib/IRCNOW/ConfigNow.pm
sub filename {
my $self = shift;
my $file = shift;
-
+ my $root = $self->{vars}->{configNow} || './configNow';
for my $mod (keys %{$self->{modules}}) {
my $filename = $self->{modules}->{$mod}->filename($file);
- return $filename if defined $filename;
+ return $root . $filename if defined $filename;
}
}