aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dbshell/exec_alias.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dbshell/exec_alias.rb')
-rw-r--r--lib/dbshell/exec_alias.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/dbshell/exec_alias.rb b/lib/dbshell/exec_alias.rb
new file mode 100644
index 0000000..7bd86b7
--- /dev/null
+++ b/lib/dbshell/exec_alias.rb
@@ -0,0 +1,11 @@
+module DBShell
+ class ExecAlias
+ def self.exec(command_args)
+ Kernel.exec(*self.build_command(command_args))
+ end
+
+ def self.build_command(command_args)
+ [ENV['SHELL'], '--login', '-c', command_args.join(' ')]
+ end
+ end
+end