post now command
This commit is contained in:
parent
972b73f665
commit
448908c18e
4 changed files with 17 additions and 1 deletions
15
blog
15
blog
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue