Code and data for arewedecentralizedyet.online and related projects
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

New helper to update 'latest' links

+30
+30
helpers/update-latest-link.sh
··· 1 + #!/bin/sh 2 + 3 + set -e 4 + 5 + if [ "$#" -eq 0 ]; then 6 + echo "Usage: $0 <dir> [dir ...]" >&2 7 + exit 1 8 + fi 9 + 10 + for dir in "$@"; do 11 + if [ ! -d "$dir" ]; then 12 + echo "Not a directory: $dir" >&2 13 + continue 14 + fi 15 + 16 + latest_name=$( 17 + find "$dir" -maxdepth 1 -type f -printf '%f\n' \ 18 + | grep -v '^latest$' \ 19 + | sort \ 20 + | tail -n 1 21 + ) 22 + 23 + if [ -z "$latest_name" ]; then 24 + echo "No files found in $dir" >&2 25 + continue 26 + fi 27 + 28 + ln -sfn "$latest_name" "$dir/latest" 29 + echo "Linked $dir/latest -> $latest_name" 30 + done