Skip to content

Commit

Permalink
update print course script
Browse files Browse the repository at this point in the history
  • Loading branch information
fey committed Aug 26, 2024
1 parent 8cc7605 commit 9933daf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
5 changes: 2 additions & 3 deletions course.mk
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,5 @@ markdown-lint-fix:
spellcheck:
docker run --rm -v ./:/content hexlet/languagetool-cli node ./bin/run.js check /content/**/*.md

print-course-lessons-names:
$(ROOT_DIR)/scripts/print-course-lessons-names

print-course-table:
@bash $(ROOT_DIR)scripts/print-course-table
12 changes: 0 additions & 12 deletions scripts/print-course-lessons-names

This file was deleted.

13 changes: 13 additions & 0 deletions scripts/print-course-table
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# Находим все файлы spec.yml в поддиректориях
files=$(find * -mindepth 1 -maxdepth 1 -type f -name 'spec.yml')

printf "%s\t%s\t%s\n" "slug" "name" "goal"
for file in $files; do
# Парсим значение ключи из каждого файла используя утилиту yq
lesson_name=$(yq '.lesson.name' $file)
lesson_goal=$(yq '.lesson.goal' $file)
directory=$(dirname $file)
printf "%s\t%s\t%s\n" "$directory" "$lesson_name" "$lesson_goal"
done | sort -t '/' -k 2

0 comments on commit 9933daf

Please sign in to comment.