File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,8 @@ mkdir -p examples
144144cd examples || exit 1
145145
146146echo " Fetching example files list..."
147- FILES=$( curl -s " https://api.github.com/repos/pythonbpf/Python-BPF/contents/examples" | grep -o ' "path": "examples/[^"]*"' | awk -F' "' ' {print $4}' )
147+ FILES=$( curl -s " https://api.github.com/repos/pythonbpf/Python-BPF/contents/examples" | grep -E -o ' "path": "examples/[^"]*(\.md|\.ipynb|\.py)"' | awk -F' "' ' {print $4}' )
148+ BCC_EXAMPLES=$( curl -s " https://api.github.com/repos/pythonbpf/Python-BPF/contents/BCC-Examples" | grep -E -o ' "path": "BCC-Examples/[^"]*(\.md|\.ipynb|\.py)"' | awk -F' "' ' {print $4}' )
148149
149150if [ -z " $FILES " ]; then
150151 echo " Failed to fetch file list from repository. Using fallback method..."
@@ -166,11 +167,20 @@ if [ -z "$FILES" ]; then
166167 curl -s -O " https://raw.githubusercontent.com/pythonbpf/Python-BPF/master/examples/$example "
167168 done
168169else
170+ mkdir examples && cd examples
169171 for file in $FILES ; do
170172 filename=$( basename " $file " )
171173 echo " Downloading: $filename "
172174 curl -s -o " $filename " " https://raw.githubusercontent.com/pythonbpf/Python-BPF/master/$file "
173175 done
176+ cd ..
177+ mkdir BCC-Examples && cd BCC-Examples
178+ for file in $BCC_EXAMPLES ; do
179+ filename=$( basename " $file " )
180+ echo " Downloading: $filename "
181+ curl -s -o " $filename " " https://raw.githubusercontent.com/pythonbpf/Python-BPF/master/$file "
182+ done
183+ cd ..
174184fi
175185
176186cd " $WORK_DIR " || exit 1
You can’t perform that action at this time.
0 commit comments