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