Skip to content

Commit

Permalink
new_lecture.sh: Fix creation of new lectures when othe files exist
Browse files Browse the repository at this point in the history
  • Loading branch information
rafasgj committed Apr 25, 2024
1 parent 6a98f72 commit 84272e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion _utils/new_lecture.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ LECTURE="teaching/lasalle/${year}/lectures/${nick}"
LECTURE_DIR="${BASEDIR}/${LECTURE}"
mkdir -p "${LECTURE_DIR}"

next_lecture=$({ echo "lecture-00.md" ; ls -1 "${LECTURE_DIR}" || die "Invalid lecture directory: ${LECTURE_DIR}" ; } | sed -e "/index/d" | tail -n 1 | xargs basename -s .md | cut -d- -f2)
next_lecture=$({ echo "lecture-00.md" ; ls -1 "${LECTURE_DIR}"/lecture-*.* || die "Invalid lecture directory: ${LECTURE_DIR}" ; } | sed -e "/index/d" | tail -n 1 | xargs basename -s .md | cut -d- -f2)

next_lecture=$(printf "lecture-%02d.md" $(echo "1 + ${next_lecture}" | bc -l))

Expand Down

0 comments on commit 84272e1

Please sign in to comment.