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

use_file: Copies local file to app/www #520

Merged
merged 1 commit into from Oct 13, 2020
Merged

Conversation

KasperThystrup
Copy link
Contributor

@KasperThystrup KasperThystrup commented Oct 2, 2020

Made a use_file function that copies a specified local file to the project app/www directory.

This is linked to #465

I added the following new functions:

use_files.R:
use_file(path, name, ...)

utils.R:
cat_start_copy()
cat_copied(where, file = "File")

devtools::check() comes up with two errors

  1. Failure: add_files (@test-add_files.R#49)
  2. Failure: add_files (@test-add_files.R#49)

Documentation:

I added @param path to the use_files documentation
I used an earlier version of Roxygen, so beware of those potential changes in [man/document_and_reload.Rd]

!This is my very first PR (ever), so please let me know if anything is missing.!

@KasperThystrup KasperThystrup changed the title use_file added: Copies local file to app/www use_file: Copies local file to app/www Oct 2, 2020
@KasperThystrup KasperThystrup marked this pull request as ready for review October 2, 2020 07:43
#' @export
#' @rdname use_file
#' @importFrom fs path_abs file_exists
use_file <- function(
Copy link
Member

Choose a reason for hiding this comment

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

Hey,

Thanks 💪

Could you name this use_internal_file() please?

Also, would you fancy making the use_internal_css_file(), use_internal_js_file() and use_internal_html_template()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure thing!

Looking through the external functions, I saw that you use @importFrom fs path_abs, Since you also use fs::file_exists I took a chance and added that to the Roxygen skeleton (and cleaned up the fs:: bits). If you prefer to have it reverted, let me know.

devtools::check() still results in the same two aforementioned failures.

I have only made minimal checks on the js, html, and css file handlers. I can confirm that they provide their respective messages, as well as it copies their target files to the www. js and css also successfully checks for file extensions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See #529. (Should I close this request then?)

@ColinFay ColinFay merged commit 19c4943 into ThinkR-open:dev Oct 13, 2020
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.

None yet

2 participants