From 50a5eeab4163bf928922330f6dff08b884e60e24 Mon Sep 17 00:00:00 2001 From: kernoeb Date: Mon, 18 Sep 2023 21:00:12 +0200 Subject: [PATCH] Delete move.fish --- move.fish | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 move.fish diff --git a/move.fish b/move.fish deleted file mode 100644 index c4e8c6c..0000000 --- a/move.fish +++ /dev/null @@ -1,24 +0,0 @@ -#!/opt/homebrew/bin/fish - -set DL_DIR ./static/img/members - -for file in content/members/*.md - echo $file - set urls (rg --only-matching --multiline --no-filename -N "http.*?\.(png|jpe?g|gif|svg|webp)" "$file" | sort -u) - for url in $urls - echo $url - set article_name (basename $file .md) - set filename (basename $url) - set filepath $DL_DIR/"$filename" - if test -f $filepath - # avoid collision - set filename (date +%s)-$filename - set filepath $DL_DIR/"$filename" - end - mkdir -p $DL_DIR/"$article_name" - curl -o $filepath $url - sed -i '' -e "s|$url|/img/articles/$filename|g" $file - end - echo - echo -end