]> git.nbdom.net Git - nb.git/commitdiff
dbq-shell
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 11 Aug 2016 22:50:36 +0000 (00:50 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 11 Aug 2016 22:50:36 +0000 (00:50 +0200)
bin/dbq
bin/dbq-shell [new file with mode: 0755]

diff --git a/bin/dbq b/bin/dbq
index c87a723d6e583a3ba32647d6c5a5b1b612416c43..bc939a24c2032dcfa139c107194dcf3c8e4fa2b6 100755 (executable)
--- a/bin/dbq
+++ b/bin/dbq
@@ -4,6 +4,11 @@ use warnings;
 use Encode;
 use URI::Escape;
 use File::Spec;
+
+BEGIN {
+  use Cwd;
+  unshift(@INC, Cwd::abs_path( ($0 =~ m|^(.*?)/[^/]+$| ? $1 : '/').'/../lib/perl' ))
+}
 use NB::Functions qw/html2txt/;
 use NB qw/$ROOT_DIR/;
 #################################################################################
diff --git a/bin/dbq-shell b/bin/dbq-shell
new file mode 100755 (executable)
index 0000000..d251fcb
--- /dev/null
@@ -0,0 +1,6 @@
+#!/usr/bin/env sh
+NAME="$(basename "${0}")"
+PATH="$PATH:$(cd "$(dirname "${0}")"; echo $(pwd))"
+while read line;
+  do eval "dbq $line"
+done