diff options
author | Yehonal <yehonal.azeroth@gmail.com> | 2016-08-30 02:02:08 +0200 |
---|---|---|
committer | Yehonal <yehonal.azeroth@gmail.com> | 2016-08-30 02:02:08 +0200 |
commit | cb375d00adeceda37fe1a71ae9c9ec7c440d6d06 (patch) | |
tree | e44ad2e9c7bb3587782f020a925a35539db40b47 /bin/db_assembler | |
parent | 8376e13e09d5bc0b33003fda0dbb975c6a1fd141 (diff) |
[BASH] Removed _timed_ files for custom sql
use updates instead.
Diffstat (limited to 'bin/db_assembler')
-rwxr-xr-x | bin/db_assembler/db_assembler.sh | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/bin/db_assembler/db_assembler.sh b/bin/db_assembler/db_assembler.sh index 8153637ac2..74902ab729 100755 --- a/bin/db_assembler/db_assembler.sh +++ b/bin/db_assembler/db_assembler.sh @@ -98,11 +98,12 @@ function assemble() { n="registry__$hash" if [[ -z ${!n} ]]; then if [ ! -e $updFile ]; then - echo "" > $updFile + echo "-- assembled updates" > $updFile fi printf -v "registry__${hash}" %s "$file" echo "-- New update sql: "$file + echo "-- $file" cat "$entry" >> $updFile fi done @@ -112,7 +113,7 @@ function assemble() { fi if [ $with_custom = true ]; then - custFile=$OUTPUT_FOLDER$database$suffix_custom"_"$curTime".sql" + custFile=$OUTPUT_FOLDER$database$suffix_custom".sql" if [ ! ${#custom[@]} -eq 0 ]; then echo "Generating $OUTPUT_FOLDER$database$suffix_custom ..." @@ -127,19 +128,12 @@ function assemble() { continue fi - file=$(basename "$entry") - hash=$($MD5_CMD "$entry") - hash="${hash%% *}" #remove file path - n="registry__$hash" - if [[ -z ${!n} ]]; then - if [ ! -e $custFile ]; then - echo "" > $custFile - fi - - printf -v "registry__${hash}" %s "$file" - echo "-- New custom sql: "$file - cat "$entry" >> $custFile + if [[ ! -e $custFile ]]; then + echo "-- assembled custom" > "$custFile" fi + + echo "-- $file" >> $custFile + cat "$entry" >> $custFile done fi done |