From 3ddd822c153d64097d8a215a14500262b275269e Mon Sep 17 00:00:00 2001 From: kake26 Date: Sun, 13 Apr 2025 21:54:16 -0500 Subject: [PATCH] Save point good cd and history --- .gitignore | 1 + lib/History/SQLite.pm | 4 ++++ lib/pshell_history.db | 0 3 files changed, 5 insertions(+) create mode 100644 .gitignore delete mode 100644 lib/pshell_history.db 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