mirror of
https://github.com/agarrharr/awesome-cli-apps
synced 2025-07-04 20:38:28 +02:00
Remove deprecated projects and update script for checking deprecations
This commit is contained in:
parent
a50265b94d
commit
8a3875953b
2 changed files with 27 additions and 22 deletions
|
@ -14,21 +14,32 @@ EOF
|
|||
exit
|
||||
fi
|
||||
|
||||
APPS=$(cat readme.md | grep -e "- \[.\+\]\(.\+\)\s" | grep 'github.com' | awk -F "(" '{ print $2 }' | cut -d ")" -f1)
|
||||
check_if_archived_on_github() {
|
||||
APPS=$(grep -e "- \[.\+\]\(.\+\)\s" readme.md | grep 'github.com' | awk -F "(" '{ print $2 }' | cut -d ")" -f1)
|
||||
|
||||
check_deprecation() {
|
||||
REPO="$1"
|
||||
if nice curl -SsL "$REPO" | grep "This repository has been archived by the owner. It is now read-only." >/dev/null; then
|
||||
echo "DEPRECATED $REPO" | tee -a $OUT_FILE
|
||||
else
|
||||
echo "CHECKED $REPO"
|
||||
fi
|
||||
check_deprecation() {
|
||||
REPO="$1"
|
||||
if nice curl -SsL "$REPO" | grep "This repository has been archived by the owner on" >/dev/null; then
|
||||
echo "DEPRECATED $REPO" | tee -a $OUT_FILE
|
||||
else
|
||||
echo "CHECKED $REPO"
|
||||
fi
|
||||
}
|
||||
|
||||
# parallel exec: https://unix.stackexchange.com/a/216475
|
||||
for app in $(echo $APPS); do
|
||||
((i=i%J)); ((i++==0)) && wait
|
||||
check_deprecation "$app" &
|
||||
done
|
||||
}
|
||||
|
||||
# parallel exec: https://unix.stackexchange.com/a/216475
|
||||
for app in $(echo $APPS); do
|
||||
((i=i%J)); ((i++==0)) && wait
|
||||
check_deprecation "$app" &
|
||||
done
|
||||
check_if_link_is_dead() {
|
||||
command -v deadlink >/dev/null || { echo "deadlink is not installed" 1>&2; exit 127; }
|
||||
|
||||
deadlink check readme
|
||||
tmp=$(mktemp)
|
||||
grep -Po "http[^)]+" readme.md | grep -v "https://github.com" >$tmp
|
||||
deadlink check $tmp
|
||||
}
|
||||
|
||||
check_if_archived_on_github
|
||||
check_if_link_is_dead
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue