diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f1fd81c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +pshell_history.db \ No newline at end of file diff --git a/lib/History/SQLite.pm b/lib/History/SQLite.pm index 42706e2..0b58902 100644 --- a/lib/History/SQLite.pm +++ b/lib/History/SQLite.pm @@ -1,6 +1,7 @@ package History::SQLite; use DBI; +use Cwd; sub new { my ($class, %args) = @_; @@ -9,6 +10,9 @@ sub new { db_path => $args{db_path} || 'command_history.db' }, $class; + # Convert to absolute path + $self->{db_path} = getcwd() . '/' . $self->{db_path} unless $self->{db_path} =~ m|^/|; + $self->_init_db; return $self; diff --git a/lib/pshell_history.db b/lib/pshell_history.db deleted file mode 100644 index e69de29..0000000