Skip to content

Commit 3beecde

Browse files
committed
fix: wrong things during merge
1 parent f1f6401 commit 3beecde

File tree

9 files changed

+45
-21
lines changed

9 files changed

+45
-21
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

crates/website/src/content/wiki.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub struct GitInfo {
4949

5050
pub fn get_git_info() -> Result<HashMap<String, GitInfo>, Box<dyn Error>> {
5151
let output = Command::new("bash")
52-
.arg("./scripts/getLastModified.sh")
52+
.arg("../../scripts/getLastModified.sh")
5353
.output()?;
5454

5555
let stdout = String::from_utf8(output.stdout)?;

crates/website/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn main() -> Result<BuildOutput, Box<dyn std::error::Error>> {
1919
content_sources(".".to_owned()),
2020
BuildOptions {
2121
assets: AssetsOptions {
22-
tailwind_binary_path: "./node_modules/.bin/tailwindcss".into(),
22+
tailwind_binary_path: "../../node_modules/.bin/tailwindcss".into(),
2323
..Default::default()
2424
},
2525
..Default::default()

scripts/getLastModified.sh

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,47 @@
1-
# List of commit hashes to ignore
2-
# Most of these commits were site-wide changes that did not affect the content
3-
ignore_commits=("67f6075f51de7c62327fba114e9310774f94fb95" "03eb7d5aea2e4750b1db40aa363b36b409d802a6" "1c14119c3afb28a20f892926de83e7f7c9eb8141" "c02f425d27b9dd76f451f3fec0fbf45979fd1048" "0d2a48e2e108d3ebb1ee6c0d825097b55c997394" "5d77a63b0f1899235bbabd6a6629f3306efd6af4" "c5838bc8b91c59fd7fbe5743dea6d5052d7427e5" "fa0ae14cfdaf0c51f51f7bbef398ccd4496d23b7" "ccad2024da87cc5ad70a7d34e6425ac9f1062b93" "6aa96e1c68ceb62ed99efa0f4173b8f79f5dc6eb" "267bb26f822c361da2386c9325764a9c99e65316" "feb7d14386e877e8f6f0781bad8c001addcd9971" "d1cd416ec70a5d12930c338a49c9beb41d853734")
1+
#!/usr/bin/env bash
2+
set -euo pipefail
43

5-
find content/wiki -name "*.md" | while read fname; do
6-
echo -n "$fname|"
4+
ignore_commits=(
5+
"67f6075f51de7c62327fba114e9310774f94fb95"
6+
"03eb7d5aea2e4750b1db40aa363b36b409d802a6"
7+
"1c14119c3afb28a20f892926de83e7f7c9eb8141"
8+
"c02f425d27b9dd76f451f3fec0fbf45979fd1048"
9+
"0d2a48e2e108d3ebb1ee6c0d825097b55c997394"
10+
"5d77a63b0f1899235bbabd6a6629f3306efd6af4"
11+
"c5838bc8b91c59fd7fbe5743dea6d5052d7427e5"
12+
"fa0ae14cfdaf0c51f51f7bbef398ccd4496d23b7"
13+
"ccad2024da87cc5ad70a7d34e6425ac9f1062b93"
14+
"6aa96e1c68ceb62ed99efa0f4173b8f79f5dc6eb"
15+
"267bb26f822c361da2386c9325764a9c99e65316"
16+
"feb7d14386e877e8f6f0781bad8c001addcd9971"
17+
"d1cd416ec70a5d12930c338a49c9beb41d853734"
18+
"f1f64019dbc4c68ba0930fabcb09bcba00f5f1ac"
19+
)
720

8-
# Initialize variables
9-
commit_found=false
10-
commit_index=1
21+
# Determine job count (cross-platform)
22+
if command -v nproc >/dev/null 2>&1; then
23+
JOBS=$(nproc)
24+
elif [[ "$OSTYPE" == "darwin"* ]]; then
25+
JOBS=$(sysctl -n hw.ncpu)
26+
else
27+
JOBS=4
28+
fi
1129

12-
# Loop to find the first non-ignored commit
13-
while [ "$commit_found" = false ]; do
14-
current_commit=$(git log -"$commit_index" --follow --pretty="format:%H" -- "$fname" | tail -n 1)
30+
ignore_pattern=$(IFS='|'; echo "${ignore_commits[*]}")
31+
export ignore_pattern
1532

16-
if [[ ! " ${ignore_commits[@]} " =~ " ${current_commit} " ]]; then
17-
commit_found=true
18-
git log -"$commit_index" --follow --date=iso --pretty="format:%cs|%H;" -- "$fname" | tail -n 1
19-
else
20-
commit_index=$((commit_index + 1))
21-
fi
22-
done
23-
done
33+
process_file() {
34+
local fname="$1"
35+
local line
36+
line=$(git log --follow --no-patch --date=iso --pretty="format:%cs|%H;" -- "$fname" \
37+
| grep -Ev "$ignore_pattern" \
38+
| head -n 1)
39+
# No newline here
40+
printf '%s|%s' "$fname" "$line"
41+
}
42+
43+
export -f process_file
44+
45+
# Collect outputs in parallel but without newlines
46+
find content/wiki -name "*.md" -print0 |
47+
xargs -0 -P "$JOBS" -I{} bash -c 'process_file "$@"' _ {}

0 commit comments

Comments
 (0)