-
Notifications
You must be signed in to change notification settings - Fork 20
/
get_files.sh
executable file
·42 lines (37 loc) · 957 Bytes
/
get_files.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
URLS=(
#"https://raw.githubusercontent.com/ViCCo-Group/THINGSvision/master/thingsvision/bpe_simple_vocab_16e6.txt.gz"
"https://raw.githubusercontent.com/ViCCo-Group/THINGSvision/master/data/files/item_names.tsv"
"https://raw.githubusercontent.com/ViCCo-Group/THINGSvision/master/data/files/things_concepts.tsv"
)
FILES=(
#"bpe_simple_vocab_16e6.txt.gz"
"item_names.tsv"
"things_concepts.tsv"
)
v=$(python --version)
v=$(echo "$v" | cut -c10)
#path="/Users/$(whoami)/anaconda3/lib/python3.$v/site-packages/thingsvision/"
subfolder="$(pwd)/data/"
if [[ -d $subfolder ]]; then
echo "PATH $subfolder exists"
else
mkdir "$subfolder"
fi
for i in ${!URLS[@]}; do
file=${FILES[i]}
url=${URLS[i]}
curl -O "$url"
if [[ -f $file ]]; then
echo "$url successfully downloaded"
#if [[ $i -eq 0 ]]; then
# mv "$file" "$path"
#else
mv "$file" "$subfolder"
#fi
else
echo "$url not successfully downloaded"
exit -1
fi
done
cd ..