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
    . "$selfDir/with_all" Source/import by_col=1 "$@"
19
    wait # wait for asynchronous commands
20
    
21
    make inputs/.herbaria/import "$@" &
22
    sleep 5 # wait for make commands to scroll by
23
    
24
    make inputs/.geoscrub/import "$@" &
25
    sleep 5 # wait for make commands to scroll by
26
    
27
    make inputs/.NCBI/import by_col=1 "$@"
28
    # Must come after NCBI for cross links to be made
29
    make inputs/.TNRS/import "$@"
30
    
31
    wait # wait for asynchronous commands
32
    
33
    make inputs/.TNRS/tnrs/tnrs-remake wait=1 "$@" &
34
    . "$selfDir/with_all" import import_source= "$@"
35
    
36
    after_import ()
37
    {
38
        bin/make_analytical_db
39
    }
40
    
41
    jobs="$(jobs -p)"
42
    (bin/waitpid $jobs; after_import) &
43
}
44
import_all_main "$@"
(26-26/69)