Project

General

Profile

1
#!/bin/bash
2
# Imports all inputs at once
3

    
4
import_all_main ()
5
{
6
    local self="${BASH_SOURCE[0]}"
7
    local selfDir="$(dirname -- "$self")"
8
    cd "$selfDir/.."
9
    
10
    if test "${BASH_LINENO[1]}" = 0; then # was run without initial "."
11
        echo "Usage: . $self [vars...] (note initial \".\")"|fold -s >&2
12
        return 2
13
    fi
14
    
15
    make inputs/.TNRS/tnrs_accepted/reinstall
16
    make inputs/.TNRS/tnrs_other/reinstall
17
    
18
    all=1; . "$selfDir/with_all" Source/import by_col=1 "$@"
19
    wait # wait for asynchronous commands
20
    unset all
21
    
22
    make inputs/.herbaria/import "$@" &
23
    sleep 5 # wait for make commands to scroll by
24
    
25
    make inputs/.geoscrub/import "$@" &
26
    sleep 5 # wait for make commands to scroll by
27
    
28
    make inputs/.NCBI/import by_col=1 "$@"
29
    # Must come after NCBI for cross links to be made
30
    make inputs/.TNRS/import "$@"
31
    
32
    wait # wait for asynchronous commands
33
    
34
    make inputs/.TNRS/tnrs/tnrs-remake wait=1 "$@" &
35
    . "$selfDir/with_all" import import_source= "$@"
36
    
37
    after_import ()
38
    {
39
        bin/make_analytical_db
40
    }
41
    
42
    jobs="$(jobs -p)"
43
    (bin/waitpid $jobs; after_import) &
44
}
45
import_all_main "$@"
(26-26/69)