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