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

Fix: Allow shinylive-r chunks to create files in subdirectories #119

Merged
merged 3 commits into from
Aug 8, 2024

Conversation

gadenbuie
Copy link
Contributor

This PR updates build_app_resources() so that it can create files in subdirectories, e.g.

## file: R/load_data.R
data <- read.csv("data.csv")

This would previously fail because writeLines() would write to "{appdir}/R/load_data.R" but {appdir}/R doesn't exist yet.

While here I also added a check, after normalizing file$name, to make sure that file names are specified relative to the app directory and don't escape upwards.

@schloerke
Copy link
Collaborator

Thank you!

@schloerke
Copy link
Collaborator

@gadenbuie Please add a news entry and feel free to merge. Thank you!

@gadenbuie gadenbuie merged commit d3e1079 into main Aug 8, 2024
11 of 12 checks passed
@gadenbuie gadenbuie deleted the fix/app-resources-subdir branch August 8, 2024 14:46
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