mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 13:40:07 +00:00
Fix init_config_file() when config file doesn't exist yet.
This commit is contained in:
@@ -6242,8 +6242,8 @@ sub init_config_file {
|
||||
|
||||
my $config_file = get_config_file();
|
||||
eval {
|
||||
die "$config_file is not writable\n"
|
||||
unless -w $config_file;
|
||||
die "$config_file exists but is not writable\n"
|
||||
if -f $config_file && !-w $config_file;
|
||||
open my $fh, '>', $config_file
|
||||
or die "Error opening $config_file: $OS_ERROR";
|
||||
print { $fh } "api-key=$api_key\n"
|
||||
|
Reference in New Issue
Block a user