projects
/
brisk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
numeric sort for sql.d files
[brisk.git]
/
sql
/
builder.sh
diff --git
a/sql/builder.sh
b/sql/builder.sh
index
4e144b9
..
f67fa23
100755
(executable)
--- a/
sql/builder.sh
+++ b/
sql/builder.sh
@@
-8,8
+8,8
@@
DATECUR="$(date +%s)"
# functions
usage () {
echo " USAGE"
# functions
usage () {
echo " USAGE"
- echo "
./builder <command> [-d|--dryrun] [-a|-p|--allfiles|--devfiles
] [-s|--short] ..."
- echo "
./builder
<-h|--help|help>"
+ echo "
$0 <command> [-d|--dryrun] [<-a|--allfiles>|<-p|--devfiles>
] [-s|--short] ..."
+ echo "
$0
<-h|--help|help>"
echo " commands are:"
echo " create"
echo " destroy"
echo " commands are:"
echo " create"
echo " destroy"
@@
-55,12
+55,12
@@
one_or_all() {
if [ "$1" ]; then
echo "$1"
elif [ "$TYPE_FILES" = "a" ]; then
if [ "$1" ]; then
echo "$1"
elif [ "$TYPE_FILES" = "a" ]; then
- echo sql.d/[0-9]*
+ find sql.d/ -name '[0-9]*' -type f | sort -n | tr '\n' ' '
elif [ "$TYPE_FILES" = "d" ]; then
elif [ "$TYPE_FILES" = "d" ]; then
- echo sql.d/[0-9]*.{sql,devel}
+ find sql.d/ -name '[0-9]*' | egrep '.*_devel.sql$|^[^_]+.sql$' | sort -n | tr '\n' ' '
else
else
- echo sql.d/[0-9]*.sql
-
fi); do
+ find sql.d/ -name '[0-9]*' | egrep '^[^_]+.sql$' | sort -n | tr '\n' ' '
+ fi); do
echo "-- FILE BEG: $fil"
cat "$fil"
echo "-- FILE END: $fil"
echo "-- FILE BEG: $fil"
cat "$fil"
echo "-- FILE END: $fil"