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

[WIP] Implement execute-dir #184

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

asinghvi17
Copy link

This PR implements the execute-dir option in project, by cd'ing to the appropriate directory on refresh.

TODOs:

  • More reliable way of getting the project root directory
  • Tests

@asinghvi17 asinghvi17 marked this pull request as ready for review September 23, 2024 23:08
@asinghvi17
Copy link
Author

This works well enough for my purposes - what would be needed to get it over the finish line?

@MichaelHatherly
Copy link
Collaborator

Thanks for looking into this @asinghvi17.

what would be needed to get it over the finish line?

Some tests to verify the new behaviour will be needed.

Comment on lines +5 to +7
if ed == "directory"
cd(dirname(path))
elseif ed == "project"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only see a description of project here, https://quarto.org/docs/projects/code-execution.html#working-dir, not directory. Is that documented elsewhere. It also doesn't mention that you can pass a path, is that described somewhere else?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just looked this up - Quarto's project file schema defines execute-dir as an enum: [file, project], so we should probably only support those two arguments.

https://github.com/quarto-dev/quarto-cli/blob/6b363d996e31c65826c2e8186c14a5da6019af96/src/resources/schema/project.yml#L16-L24

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 12.50000% with 14 lines in your changes missing coverage. Please review.

Project coverage is 50.96%. Comparing base (899d41a) to head (3cffbfb).

Files with missing lines Patch % Lines
src/QuartoNotebookWorker/src/refresh.jl 0.00% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #184      +/-   ##
==========================================
- Coverage   51.40%   50.96%   -0.45%     
==========================================
  Files          30       30              
  Lines        1280     1295      +15     
==========================================
+ Hits          658      660       +2     
- Misses        622      635      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants