lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 15.09-beta 38 lines 581 B view raw
1#!/bin/sh 2sql_files=(@sql_srcs@) 3sql_comments=@sql_comments@ 4 5do_help(){ echo "$0 [--comments] db_name1 [db_name2 ..]"; } 6 7for arg in "$@"; do 8 case "$arg" in 9 -h|--help) 10 do_help; exit 0 11 ;; 12 --comments) 13 LOAD_COMMENTS=1 14 ;; 15 *) 16 dbs=(${dbs[@]} "$arg") 17 ;; 18 esac 19done 20 21PSQL(){ 22 echo ">> loading $1" 23 psql -d "$db" -f $1 24} 25 26for db in ${dbs[@]}; do 27 createlang plpgsql "$db" 28 29 # mandatory 30 for sql in $sql_files; do 31 PSQL $sql 32 done 33 34 # optionally load some comments 35 if [ -n "$LOAD_COMMENTS" ]; then 36 PSQL $sql_comments 37 fi 38done