Skip to content

Commit

Permalink
Add error message for missing templates. (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
coatless authored Nov 19, 2023
1 parent ac97ee9 commit e370fbb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 8 additions & 2 deletions _extensions/webr/webr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,17 @@ function readTemplateFile(template)

-- Let's hopefully read the template file...

-- Open the webr editor
-- Open the template file
local file = io.open(path, "r")

-- Check if null pointer before grabbing content
if not file then
if not file then
error("\nWe were unable to read the template file `" .. template .. "` from the extension directory.\n\n" ..
"Double check that the extension is fully available by comparing the \n" ..
"`_extensions/coatless/webr` directory with the main repository:\n" ..
"https://github.com/coatless/quarto-webr/tree/main/_extensions/webr\n\n" ..
"You may need to modify `.gitignore` to allow the extension files using:\n" ..
"!_extensions/*/*/*\n")
return nil
end

Expand Down
4 changes: 4 additions & 0 deletions docs/qwebr-release-notes.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ format:

- Minor documentation tweaks.

## Deployment

- Added an instructive error message regarding whether template files are missing. ([#107](https://github.com/coatless/quarto-webr/issues/107))

# 0.3.9: Zoom-Zoom (11-16-2023)

## Breaking changes
Expand Down

0 comments on commit e370fbb

Please sign in to comment.