-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_tutorials.sh
executable file
·69 lines (57 loc) · 3 KB
/
get_tutorials.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
# Downloads the tutorials (scenes and scripts).
# First, generate a folder structure like the one in github.
# Then download the scripts, and then the scenes.
# At last, display the final tree structure.
# python files to be downloaded
text_files=('https://raw.githubusercontent.com/mtxslv/guira/master/tutorials/bounding_boxes/bounding_boxes.py'
'https://raw.githubusercontent.com/mtxslv/guira/master/tutorials/connecting_to_a_scene/connecting_to_a_scene.py'
'https://raw.githubusercontent.com/mtxslv/guira/master/tutorials/move_robots/move_robots.py'
'https://raw.githubusercontent.com/mtxslv/guira/master/tutorials/sending_points/receiving_script.lua'
'https://raw.githubusercontent.com/mtxslv/guira/master/tutorials/sending_points/sending_points.py'
'https://raw.githubusercontent.com/mtxslv/guira/master/tutorials/ultrasonic_sensor/ultrasonic_sensor.py')
# local text files
file_names=('./tutorials/bounding_boxes/bounding_boxes.py'
'./tutorials/connecting_to_a_scene/connecting_to_a_scene.py'
'./tutorials/move_robots/move_robots.py'
'./tutorials/sending_points/receiving_script.lua'
'./tutorials/sending_points/sending_points.py'
'./tutorials/ultrasonic_sensor/ultrasonic_sensor.py')
# simulation scenes to be downloaded
simulation_scenes=('https://raw.githubusercontent.com/mtxslv/guira/master/tutorials/bounding_boxes/bounding_boxes.ttt'
'https://raw.githubusercontent.com/mtxslv/guira/master/tutorials/connecting_to_a_scene/connecting_to_a_scene.ttt'
'https://raw.githubusercontent.com/mtxslv/guira/master/tutorials/move_robots/move_robots.ttt'
'https://raw.githubusercontent.com/mtxslv/guira/master/tutorials/sending_points/sending_points.ttt'
'https://raw.githubusercontent.com/mtxslv/guira/master/tutorials/ultrasonic_sensor/ultrasonic_sensor.ttt')
# local simulation scenes
simulation_names=('./tutorials/bounding_boxes/bounding_boxes.ttt'
'./tutorials/connecting_to_a_scene/connecting_to_a_scene.ttt'
'./tutorials/move_robots/move_robots.ttt'
'./tutorials/sending_points/sending_points.ttt'
'./tutorials/ultrasonic_sensor/ultrasonic_sensor.ttt')
# folders
folder_structure=('bounding_boxes'
'connecting_to_a_scene'
'move_robots'
'sending_points'
'ultrasonic_sensor')
echo 'Creating folder structure...'
mkdir 'tutorials/'
for index in "${!folder_structure[@]}";
do
mkdir "tutorials/${folder_structure[$index]}"
done
echo 'Downloading text files...'
for index in "${!text_files[@]}";
do
curl ${text_files[$index]} --output ${file_names[$index]}
done
echo 'Downloading the simulation scenes...'
for index in "${!simulation_scenes[@]}";
do
curl ${simulation_scenes[$index]} --output ${simulation_names[$index]}
done
clear
echo 'Done!'
echo ';)'
tree ./tutorials