Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quarto use template no longer works for directories without a _extensions/ folder #9256

Open
cwickham opened this issue Apr 2, 2024 · 1 comment · May be fixed by #9261
Open

quarto use template no longer works for directories without a _extensions/ folder #9256

cwickham opened this issue Apr 2, 2024 · 1 comment · May be fixed by #9261
Assignees
Labels
bug Something isn't working extensions relates to Quarto extensions mechanism regression Functionality that used to work but now is broken.
Milestone

Comments

@cwickham
Copy link
Collaborator

cwickham commented Apr 2, 2024

Bug description

quarto use template used to work to copy the contents on a Git repo, regardless of its contents. It now seems to fail if there is no _extensions/ directory.

Steps to reproduce

quarto use template EmilHvitfeldt/website-template

Follow prompts:

Quarto templates may execute code when documents are rendered. If you do not 
trust the authors of the template, we recommend that you do not install or 
use the template.
? Do you trust the authors of this template (Y/n) › Yes
? Create a subdirectory for template? (Y/n) › Yes
? Directory name: › website

Expected behavior

In 1.4.551:

[✓] Downloading
[✓] Unzipping
[✓] Copying files...

Files created:
 - _quarto.yml
 - index.qmd
 - styles.scss
 - blog
 - about.qmd
 - _site
 - profile.png
 - about.jpg
 - blog.qmd

Actual behavior

On main:

[✓] Downloading
[✓] Unzipping
ERROR: NotFound: No such file or directory (os error 2): readdir '/var/folders/1q/1yytldpd03z8426k84g_tzsc0000gp/T/quarto-session7d84bbb9865dbec1/d25b5c65803b11d5/ba8e12719bcb7bd3/archive/website-template-main/_extensions'

Stack trace:
    at Object.readDirSync (ext:deno_fs/30_fs.js:211:10)
    at readExtensions (file:///Users/charlottewickham/Documents/posit/quarto-cli/src/extension/extension.ts:416:30)
    at useTemplate (file:///Users/charlottewickham/Documents/posit/quarto-cli/src/command/use/commands/template.ts:88:38)
    at eventLoopTick (ext:core/01_core.js:153:7)
    at async Command.actionHandler (file:///Users/charlottewickham/Documents/posit/quarto-cli/src/command/use/commands/template.ts:52:7)
    at async Command.execute (file:///Users/charlottewickham/Documents/posit/quarto-cli/src/vendor/deno.land/x/cliffy@v1.0.0-rc.3/command/command.ts:1948:7)
    at async Command.parseCommand (file:///Users/charlottewickham/Documents/posit/quarto-cli/src/vendor/deno.land/x/cliffy@v1.0.0-rc.3/command/command.ts:1780:14)
    at async quarto (file:///Users/charlottewickham/Documents/posit/quarto-cli/src/quarto.ts:156:3)
    at async file:///Users/charlottewickham/Documents/posit/quarto-cli/src/quarto.ts:170:5
    at async mainRunner (file:///Users/charlottewickham/Documents/posit/quarto-cli/src/core/main.ts:35:5)

Your environment

  • Mac OS 14.4.1

Quarto check output

Quarto 99.9.9
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.11: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.41.0: OK
      Typst version 0.10.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 99.9.9
      commit: 26172cb90eb6c2d41742df662771c1d4b2197a3f
      Path: /Users/charlottewickham/Documents/posit/quarto-cli/package/dist/bin

[✓] Checking tools....................OK
      TinyTeX: v2024.03.13
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/charlottewickham/Library/TinyTeX/bin/universal-darwin
      Version: 2024

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.12.2
      Path: /Users/charlottewickham/.pyenv/versions/3.12.2/bin/python3
      Jupyter: 5.7.2
      Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.3.3
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
      knitr: 1.45
      rmarkdown: 2.26

[✓] Checking Knitr engine render......OK
@cwickham cwickham added the bug Something isn't working label Apr 2, 2024
@cscheid cscheid self-assigned this Apr 2, 2024
@cscheid cscheid added the regression Functionality that used to work but now is broken. label Apr 2, 2024
@mcanouil mcanouil added the extensions relates to Quarto extensions mechanism label Apr 2, 2024
@cderv
Copy link
Collaborator

cderv commented Apr 3, 2024

This happens at

// Compute extensions that need to be installed (and confirm any)
// changes
const extDir = join(stagedDir, kExtensionDir);
// Determine whether we can update extensions
const templateExtensions = await readExtensions(extDir);

Change was introduced by

cc @dragonstyle

We probably only need to handle the case where the template doesn't have an extension to comply with our documented Starter Template feature
https://quarto.org/docs/extensions/starter-templates.html#overview

@cderv cderv self-assigned this Apr 3, 2024
@cderv cderv linked a pull request Apr 3, 2024 that will close this issue
@cderv cderv added this to the v1.5 milestone Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working extensions relates to Quarto extensions mechanism regression Functionality that used to work but now is broken.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants