1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/lupyuen-stm32-blue-pill-rust

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
gen-examples.sh 1.1 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
Lee Lup Yuen Отправлено 06.07.2018 04:13 270d202
# Converts the examples in the `examples` directory into documentation in the
# `examples` module (`src/examples/*.rs`)
set -ex
main() {
local examples=(
minimal
hello
itm
panic
crash
exception
allocator
device
)
rm -rf src/examples
mkdir src/examples
cat >src/examples/mod.rs <<'EOF'
//! Examples sorted in increasing degree of complexity
// Auto-generated. Do not modify.
EOF
local i=0 out=
for ex in ${examples[@]}; do
name=_${i}_${ex//-/_}
out=src/examples/${name}.rs
echo "pub mod $name;" >> src/examples/mod.rs
grep '//!' examples/$ex.rs > $out
echo '//!' >> $out
echo '//! ```' >> $out
grep -v '//!' examples/$ex.rs | (
IFS=''
while read line; do
echo "//! $line" >> $out;
done
)
echo '//! ```' >> $out
echo '// Auto-generated. Do not modify.' >> $out
chmod -x $out
i=$(( i + 1 ))
done
chmod -x src/examples/mod.rs
}
main

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/lupyuen-stm32-blue-pill-rust.git
git@api.gitlife.ru:oschina-mirror/lupyuen-stm32-blue-pill-rust.git
oschina-mirror
lupyuen-stm32-blue-pill-rust
lupyuen-stm32-blue-pill-rust
master