Skip to content

Commit

Permalink
Create the Sidef config directory when it doesn't exist.
Browse files Browse the repository at this point in the history
This fixes the creation of the history file, which is located under the Sidef config directory (when this directory doesn't exist).
  • Loading branch information
trizen committed Nov 8, 2021
1 parent d467360 commit 062fbdb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/Sidef.pm
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ package Sidef {
'.config',
'sidef'
);

if (not -d $self->{sidef_config_dir}) {
require File::Path;
File::Path::make_path($self->{sidef_config_dir})
or warn "[WARNING] Can't create directory <<$self->{sidef_config_dir}>>: $!";
}

return $self->{sidef_config_dir};
}

sub get_sidef_vdir {
Expand Down

0 comments on commit 062fbdb

Please sign in to comment.