diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Net/MulkyID/Builder.pm | 4 | ||||
-rwxr-xr-x | lib/Net/MulkyID/Setup.pm | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/Net/MulkyID/Builder.pm b/lib/Net/MulkyID/Builder.pm index a1c000d..bd5058f 100644 --- a/lib/Net/MulkyID/Builder.pm +++ b/lib/Net/MulkyID/Builder.pm @@ -18,7 +18,9 @@ sub new { sub ACTION_build { my ($self, @args) = @_; eval "use Net::MulkyID::Setup; setup();"; - #return SUPER::ACTION_build($self, @args); + if ($@) { + die $@; + } } 1; diff --git a/lib/Net/MulkyID/Setup.pm b/lib/Net/MulkyID/Setup.pm index 8c58013..b79f96b 100755 --- a/lib/Net/MulkyID/Setup.pm +++ b/lib/Net/MulkyID/Setup.pm @@ -12,6 +12,7 @@ use File::Path qw(make_path); use File::Copy; use LWP::Simple qw(getstore); use Data::Dumper; +#use autodie; use base 'Exporter'; our @EXPORT = qw(setup); @@ -80,7 +81,8 @@ sub setup() { } else { say "Generating private key..."; $key = Crypt::OpenSSL::RSA->generate_key(2048); - make_path($configpath); + make_path($configpath) + or die "Could not create directory: $configpath"; write_file($pemfile, $key->get_private_key_string()) or die "Could not write private key to $pemfile: $!"; say "Private key saved to: $pemfile"; |