Add ipkg path to idrispost

This commit is contained in:
Nathan McCarty 2025-02-03 23:43:19 -05:00
parent addce4f87c
commit 56833369ce
2 changed files with 20 additions and 0 deletions

7
blog
View file

@ -25,6 +25,9 @@ my IO::Path:D $default-db-dir =
#| The default output directory
my IO::Path:D $default-site-dir = $default-blog-dir.add('site/');
#| The default idris ipkg
my IO::Path:D $default-ipkg = $default-blog-dir.add('projects/Idris/Idris.ipkg');
#| Initalize the database
multi MAIN(
"db",
@ -92,6 +95,8 @@ multi MAIN(
"idris",
#| The path to the idris file
IO::Path(Str) $source,
#| The path to the ipkg file
IO::Path(Str) :$ipkg = $default-ipkg,
#| The path of the database file
IO::Path(Str) :$db-dir = $default-db-dir,
#| The date/time the post should be recorded as posted at
@ -99,6 +104,7 @@ multi MAIN(
#| Should the post be hidden from the archive?
Bool :$hidden = False,
) {
say $default-ipkg;
my $db = read-db $db-dir;
my $id =
$db.insert-post:
@ -106,6 +112,7 @@ multi MAIN(
source => $source.absolute.IO,
posted-at => $posted-at,
hidden => $hidden,
ipkg => $ipkg.absolute.IO,
);
$db.write: $db-dir;
say 'Post inserted with id ', $id;