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

No check for an unsaved script #158

Open
jeffeaton opened this issue Jul 4, 2024 · 4 comments
Open

No check for an unsaved script #158

jeffeaton opened this issue Jul 4, 2024 · 4 comments

Comments

@jeffeaton
Copy link

A common silly thing I do is to create an orderly task, create a script and do a lot of development in it, but then forget to save it and run the report.

In orderly1, this would throw a "script my-script.R does not exist" error or something like that. In orderly2, this doesn't give me any indication that I've probably done a silly thing.

root1 <- tempfile()
orderly_init(root1)

setwd(root1)
orderly_new("hello", template = FALSE)

## Open the script and develop a lot
## Forgot to save it though!

orderly_run("hello")

## > orderly_run("hello")
## ℹ Starting packet 'hello' `20240704-225610-cc4efc1c` at 2024-07-05 00:56:10.803153
## ✔ Finished running hello.R
## ℹ Finished 20240704-225610-cc4efc1c at 2024-07-05 00:56:10.820007 (0.01685405 secs)
## [1] "20240704-225610-cc4efc1c"
## 
## Oh no! That has just run an empty script
## and committed it into my archive! Oops,
## how silly!

Minor thing, but I missed that old error message saving me today, if there's anything that could be checked to warn me not done what I want.

@richfitz
Copy link
Member

richfitz commented Jul 5, 2024

I am not sure that there was something we detected previously, unless you had literally nothing in the directory. The idea that orderly reports can be trivial is one of the aims here, so there's not a lot we can warn about.

@jeffeaton
Copy link
Author

Yeah, fair. Previously the orderly task would not run if (1) orderly.yml was not saved with a script: <script>.R specified, or (2) the file <script.R> was not found (which in orderly1 was not created by orderly_new()). This saved me a surprising amount of grief; but appreciate that it's just a user silliness and not particularly important thing to flag.

@plietar
Copy link
Member

plietar commented Jul 8, 2024

If you are using RStudio we might be able to use the API to detect an unsaved report and show a warning. I don't know how useful or desirable it is though?

@jeffeaton
Copy link
Author

Thanks, yeah, I don't know how to use RStudio unfortunately :). I think we can close this out. Pain free deleting from the archive will make this more of a shrug.

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

No branches or pull requests

3 participants