post now command

This commit is contained in:
Nathan McCarty 2025-02-09 18:09:06 -05:00
parent 972b73f665
commit 448908c18e
4 changed files with 17 additions and 1 deletions

15
blog
View file

@ -284,6 +284,21 @@ multi MAIN(
$db.write: $db-dir;
}
#| Update the posted-at time on a post to the current time
multi MAIN(
"post",
"now",
#| The id of the post to update the posted-at time
Int $id,
#| The path of the database directory
IO::Path(Str) :$db-dir = $default-db-dir,
){
my $db = read-db $db-dir;
my $post = $db.posts{$id.Int};
$post.posted-at = DateTime.now;
$db.write: $db-dir;
}
#| Create a new series
multi MAIN(
"series",