" 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'
\,'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
--- /dev/null
+#!/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
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"
}