Skip to content

Commit a9a304d

Browse files
author
Alicja Kucharczyk
committed
broken link
1 parent 6f074e2 commit a9a304d

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
for file in ../flexible-server/*.md; do
4+
last_commit_date=$(git log -1 --pretty="format:%ad" --date=format:"%m/%d/%Y" -- "$file")
5+
echo $last_commit_date
6+
if [ ! -z "$last_commit_date" ]; then
7+
sed -i "s|ms.date: [0-9]\{2\}\/[0-9]\{2\}\/[0-9]\{4\}|ms.date: $last_commit_date|" "$file"
8+
fi
9+
done
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
# Path to the TOC.yml file
4+
tocPath="../TOC.yml"
5+
6+
# Check if the TOC.yml file exists
7+
if [ ! -f "$tocPath" ]; then
8+
echo "TOC.yml file does not exist in the parent directory."
9+
exit 1
10+
fi
11+
12+
# The directory where the markdown files are located relative to the script
13+
mdFilesDir="../flexible-server/"
14+
15+
# Check if the markdown files directory exists
16+
if [ ! -d "$mdFilesDir" ]; then
17+
echo "Markdown files directory does not exist."
18+
exit 1
19+
fi
20+
21+
# Loop through all .md files in the markdown files directory
22+
for mdFileFullPath in "$mdFilesDir"*.md; do
23+
# Extracting the filename with path relative to the parent directory
24+
relativePath="${mdFileFullPath#../}"
25+
26+
# Creating the search pattern expected in the TOC.yml
27+
searchPattern=" href: ${relativePath}"
28+
29+
# Check if the pattern exists in the TOC.yml file
30+
if ! grep -q "$searchPattern" "$tocPath"; then
31+
# Print the relative path of the .md file from the parent directory
32+
echo "$relativePath"
33+
fi
34+
done

0 commit comments

Comments
 (0)