]> git.nbdom.net Git - nb.git/commitdiff
nb-commit
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Sat, 7 Jan 2017 20:03:17 +0000 (20:03 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Sat, 7 Jan 2017 20:03:17 +0000 (20:03 +0000)
bin/nb-commit [new file with mode: 0755]
etc/profile
share/db/update.sh

diff --git a/bin/nb-commit b/bin/nb-commit
new file mode 100755 (executable)
index 0000000..b1ced22
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/env sh
+#####################################################################
+#
+# Compile, update source code
+# Called by cron/etc/nb
+#
+#####################################################################
+set -e
+. $(dirname "$0")/../etc/profile || exit 1; [ -z "$NB_ROOT" ] && exit
+
+cd $NB_ROOT || exit
+
+share/db/update.sh
+
+which docker 1> /dev/null && docker run --rm -v $NB_ROOT:$NB_ROOT alpine sh -c "(. $NB_ROOT/etc/profile && nb_repos) >/dev/null && echo Docker: OK"
+
index 7ef448bc96f245db39b63599f93aa608a97f866e..0fac7cb14c5fa9689a749d3a497ba1b64e57195f 100755 (executable)
@@ -1,8 +1,12 @@
+#--------------------------------------------------------------------------------
 #
 # etc/profile
 #
+# To test:
 # docker run --rm -it -v $NB_ROOT:$NB_ROOT alpine sh -c " . $NB_ROOT/etc/profile --debug && nb_repos && echo OK"
 #
+#
+#--------------------------------------------------------------------------------
 [ "$1" = "--debug" ] && export NB_DEBUG="echo DEBUG: " && shift
 
 #
index 807cc977098adcb5a5dcf9d608aac64d4cff2bb6..6d96a7696d9d744565c9f179f130c8525c76ae1e 100755 (executable)
@@ -1,21 +1,23 @@
 #!/usr/bin/env bash --login
 set -e
 cd "$(dirname "$0")"
-
-echo "Update sys.shell_function"
-
 (
 
 cat << EOF
 PRAGMA foreign_keys=OFF;
 BEGIN TRANSACTION;
-EOF
 
-shell_functions2sql shell_function
+SELECT 'Update sys.shell_function';
+`shell_functions2sql shell_function`
 
-cat << EOF
 COMMIT;
 EOF
 
 ) | sqlite3 sys.db
 
+IFS=$'\n'
+for f in $(grep -lrI SHELL_REPLACE $NB_ROOT); do
+
+  echo "Update $f"
+  shell_replace -i "$f"
+done