2024-02-17 20:58:54 +01:00
|
|
|
#! /usr/bin/env nu
|
|
|
|
|
|
|
|
def main () {
|
2024-02-27 14:47:33 +01:00
|
|
|
let paths: list<string> = (git diff --name-only | split row "\n" | filter {|p| $p | str contains "content/b"});
|
|
|
|
let posts: string = (ls content/b | filter {|p| $p.type == "dir"} | each {|p| $p.name | sed 's/content\/b\///g'});
|
2024-02-17 20:58:54 +01:00
|
|
|
|
|
|
|
for post in $posts {
|
2024-02-27 14:47:33 +01:00
|
|
|
if $"content/b/($post)/index.md" in $paths {
|
2024-02-17 20:58:54 +01:00
|
|
|
echo $"`($post)` post has been modified";
|
|
|
|
python3 ./scripts/article.py card $post
|
|
|
|
python3 ./scripts/article.py update $post "global" "updated" $"(date now | format date '%Y-%m-%d')"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|