List of publications: nicer links
This commit is contained in:
1 parent
23fc8a95cc
commit
eaa0af474b
5 files changed
+28
-19
No files matched your search
+10
-14
@@ -1,24 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
# Remove content/<section>/*.md (zettels and bibliography) whose org source in ~/Cloud/brain no longer exists.
|
||||
# Remove content/zettels/*.md whose org source in ~/Cloud/brain no longer exists.
|
||||
# Dry run by default; pass --delete to actually remove files.
|
||||
set -euo pipefail
|
||||
|
||||
brain=~/Cloud/brain
|
||||
content="$(cd "$(dirname "$0")" && pwd)/content"
|
||||
sections=(zettels book phdthesis inbook techreport article inproceedings websites)
|
||||
zet="$(cd "$(dirname "$0")" && pwd)/content/zettels"
|
||||
|
||||
count=0
|
||||
for section in "${sections[@]}"; do
|
||||
for md in "$content/$section"/*.md; do
|
||||
[[ -e $md ]] || continue
|
||||
name=$(basename "$md" .md)
|
||||
[[ $name == _index ]] && continue
|
||||
if [[ ! -f "$brain/$name.org" ]]; then
|
||||
echo "orphan: $md"
|
||||
[[ ${1:-} == --delete ]] && rm "$md"
|
||||
count=$((count + 1))
|
||||
fi
|
||||
done
|
||||
for md in "$zet"/*.md; do
|
||||
name=$(basename "$md" .md)
|
||||
[[ $name == _index ]] && continue
|
||||
if [[ ! -f "$brain/$name.org" ]]; then
|
||||
echo "orphan: $md"
|
||||
[[ ${1:-} == --delete ]] && rm "$md"
|
||||
count=$((count + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ $count -eq 0 ]]; then
|
||||
|
||||
Reference in new issue
Block a user