-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo.sh
79 lines (61 loc) · 2.12 KB
/
demo.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
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
# simple demo - it use param from cmd line to run the actual section
function setup {
# set -x
export MAP_YAML_PATH=map.yaml
pip install .
chmod +x main.py
}
function setup_zo {
cp ./zero_to_one_hundred/tests/tests_zo/resources/gcp_map.yaml map.yaml
}
function setup_sb {
cp ./zero_to_one_hundred/tests/tests_sb/resources/map.yaml map.yaml
# safari books from lorenzodifuccia
git clone https://github.com/lorenzodifuccia/safaribooks.git
pip install --quiet -r safaribooks/requirements.txt
}
function zo {
# 0to100
setup_zo
./main.py zo help
content=$(
cat <<'EOF'
https://www.cloudskillsboost.google/0
https://www.cloudskillsboost.google/paths/16
https://www.cloudskillsboost.google/games/4424/labs/28651
https://www.cloudskillsboost.google/course_templates/3
https://www.cloudskillsboost.google/games/4422
https://storage.googleapis.com/cloud-training/cls-html5-courses/T-BQRS-I/M1/index.html
EOF
)
while IFS= read -r section || [[ -n "$section" ]]; do
./main.py zo create_section "$section"
done <<<"$content"
echo "# a_custom_header 0" >>0to100/https§§§www.cloudskillsboost.google§0/readme.md
./main.py zo done_section "https://www.cloudskillsboost.google/0"
ls -1R 0to100
cp toc.md toc_zo.md
}
function sb {
# 0to100 safari books
setup_sb
./main.py sb help
./main.py sb snatch_book https://learning.oreilly.com/course/clean-code-fundamentals/9780134661742
echo 'add any metadata you like'
echo '{"title": "Clean Code Fundamentals"}' >9780134661742/9780134661742.json
./main.py sb refresh_toc
./main.py sb snatch_book https://learning.oreilly.com/library/view/rewire-your-brain/9781119895947
echo 'pretend book was read fully and get % calc for free :P'
echo '{"page_curr": "100", "page_tot": "100", "url":"https://www.oreilly.com/library/view/rewire-your-brain/9781119895947"}' >9781119895947/9781119895947.json
./main.py sb refresh_toc
ls -1R 978*
cp toc.md toc_sb.md
}
#!/bin/bash
if [ $# -eq 0 ]; then
echo "No arguments were passed: use sb or zo"
else
setup
$1
fi