Project

General

Profile

« Previous | Next » 

Revision 8213

lib/import.sh: Use `set -o errexit` so any command that exits with an error aborts the script. Note that a command's exit status can still be ignored using ` || true`. Removed no longer needed ` || return` in functions.

View differences:

lib/import.sh
12 12
mk_derived
13 13
fi
14 14

  
15
set -o errexit
16

  
15 17
import_sh_dir="$(dirname "${BASH_SOURCE[0]}")"
16 18
root_dir="$import_sh_dir"/..
17 19
bin_dir="$root_dir"/bin
......
34 36

  
35 37
map_table ()
36 38
{
37
	make --directory=.. --makefile=../input.Makefile "$table"/map.csv || return
39
	make --directory=.. --makefile=../input.Makefile "$table"/map.csv
38 40
	(psql <<EOF
39 41
SELECT util.reset_map_table('pg_temp.map');
40 42
\copy pg_temp.map FROM 'map.csv' CSV HEADER;
41 43
SELECT util.set_col_names('"$table"', 'pg_temp.map'::regclass);
42 44
EOF
43
	) || return
45
	)
44 46
}
45 47

  
46 48
mk_derived () { "$root_dir"/schemas/VegCore/mk_derived; }

Also available in: Unified diff