]> git.nbdom.net Git - nb.git/commitdiff
lib/postgres/shell_function.sql
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 10 Jan 2018 04:35:15 +0000 (04:35 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 10 Jan 2018 04:35:15 +0000 (04:35 +0000)
lib/postgres/shell_function.sql [new file with mode: 0644]

diff --git a/lib/postgres/shell_function.sql b/lib/postgres/shell_function.sql
new file mode 100644 (file)
index 0000000..cb86b66
--- /dev/null
@@ -0,0 +1,11 @@
+DROP TABLE IF EXISTS shell_function;
+CREATE TABLE shell_function (
+  name VARCHAR(255) PRIMARY KEY,
+  code TEXT
+);
+BEGIN TRANSACTION;
+DELETE FROM shell_function;
+COPY shell_function FROM PROGRAM '\
+bash -norc -c ". $NB_ROOT/etc/profile --nb-no-repos && shell_functions_csv"
+' WITH (format 'text', NULL ''); 
+COMMIT;