Commit 669e309d authored by Gary Allen Vollink's avatar Gary Allen Vollink
Browse files

Fixed for read key from file

parent 4adec00a
......@@ -1696,10 +1696,10 @@ MAIN: {
}
}
if ( -z $AppleKey ) {
if ( !length $AppleKey ) {
$AppleKey = find_apple_key();
}
if ( -z $AppleKey ) {
if ( !length $AppleKey ) {
print "No Apple Key, Unable to continue.\n";
print " - Specify on the command line with --key xxxx\n";
print " - Store in ~/.apple_key or ./.apple_key\n";
......@@ -1754,13 +1754,15 @@ sub find_apple_key
die( printf( 'Unable to open %s: %s', $fn, $! ) );
my $out = q{};
while ( my $line = <$fh> ) {
$line =~ s/\S//;
$line =~ s/\s//g;
$line =~ s/^#//g;
if ( length( $line ) ) {
$out = $line;
}
}
close( $fh );
if ( length( $out ) ) {
#print "KEY [$out]\n";
return $out;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment