Fix index.md not being generated

- Generate index even when no .org files are found
- Don't halt CLI early when no org files - let pipeline complete
- Index will be empty but present, allowing Quartz to serve something
This commit is contained in:
Ignacio Ballesteros
2026-02-22 11:45:56 +01:00
parent 11ab8336e4
commit 38b4e0b341
3 changed files with 582 additions and 3 deletions

View File

@@ -306,8 +306,7 @@ defmodule OrgGarden.CLI do
case OrgGarden.Export.export_all(notes_dir, output_dir) do
{:ok, 0} ->
IO.puts("No .org files found in #{notes_dir}")
System.halt(0)
IO.puts(" no .org files found")
{:ok, count} ->
IO.puts(" exported #{count} file(s)")

View File

@@ -150,6 +150,8 @@ defmodule OrgGarden.Server do
case OrgGarden.Export.export_all(notes_dir, output_dir) do
{:ok, 0} ->
Logger.warning("No .org files found in #{notes_dir}")
# Still generate index (will be empty or have default content)
OrgGarden.Index.generate(content_dir)
:ok
{:ok, count} ->