]> git.nbdom.net Git - nb.git/commitdiff
share/db/update.sh
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 9 Jan 2018 05:29:34 +0000 (05:29 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 9 Jan 2018 05:29:34 +0000 (05:29 +0000)
etc/vim/source/vars.vim
share/db/shell_replace.sh [new file with mode: 0644]
share/db/update.sh

index eb55ddd8a90c572b97bdd4163f458ec41a128ec5..bfc7020e4c2d992b9d55bb3044ab615a14cd30ee 100644 (file)
@@ -4,12 +4,14 @@
 " Command to check files per file types
 "
 " rows.fields=id,cmd_check
-">SHELL_REPLACE echo "let mimeCheck = {"; dbq db=$NB_DB t=mime -cut 1,3 | sort -k 1 | sed -E -e "s/'/''/g" -e "s/^(.*?)\t(.*)$/  \\\,'\1' : '\2'/" -e "0,/,/s/,//" ; echo "\}"
+">SHELL_REPLACE echo "let mimeCheck = {"; dbq db=$NB_DB t=mime rows.fields=id,cmd_check | sort -k 1 | sed -E -e "s/'/''/g" -e "s/^(.*?)\t(.*)$/  \\\,'\1' : '\2'/" -e "0,/,/s/,//" ; echo "\}"
 let mimeCheck = {
   \'bash' : 'bash -c'
   \,'erb' : 'sh -c \"cat | erb -x - | ruby -c\" <'
+  \,'haproxy.cfg' : 'haproxy -c -f'
   \,'haproxy' : 'haproxy -c -f'
   \,'html' : 'xmllint --noout --html'
+  \,'id' : 'cmd_check'
   \,'init' : 'init-checkconf'
   \,'json' : 'ruby -rjson -e ''puts JSON.parse(File.read(ARGV[0]))'''
   \,'perl' : 'perl -c -w'
@@ -18,6 +20,7 @@ let mimeCheck = {
   \,'python' : 'python -m py_compile'
   \,'ruby' : 'ruby -c'
   \,'sh' : 'sh -c'
+  \,'xml' : 'xmllint --noout'
   \,'yaml' : 'ruby -ryaml -e ''puts YAML.dump(YAML.load_file(ARGV[0]))'''
 \}
 "<SHELL_REPLACE
diff --git a/share/db/shell_replace.sh b/share/db/shell_replace.sh
new file mode 100644 (file)
index 0000000..ac33251
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/bash --login
+#
+#
+# We want a new proper bash shell, we are going to search with `set`
+#
+#
+set +e
+for f in $(shell_replace -find $NB_ROOT/*); do
+
+       echo "shell_replace $f" | sed "s; $NB_ROOT/; ;"
+       shell_replace -i.shell_replace "$f"
+
+done
index 5c6adcdfc2fe5995a534786c0d0b82fb73aaba67..7fe2315753c9b74ab6f6c520fa06ae7293893fd8 100755 (executable)
@@ -26,17 +26,7 @@ cat << EOF
 VACUUM;
 EOF
 
-) | sqlite3 "nb.db" && (
-
-false && for f in $(shell_replace -find $NB_ROOT/*); do
-
-       echo "shell_replace $f" | sed "s; $NB_ROOT/; ;"
-       shell_replace -i.shell_replace "$f"
-       #shell_replace "$f" | wc -l
-
-done
-
-)
+) | sqlite3 "nb.db"
 
 rm -rf "$TMP"
 }