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

ENH: Overwrite option in install_course_github #523

Open
muschellij2 opened this issue Aug 23, 2016 · 1 comment
Open

ENH: Overwrite option in install_course_github #523

muschellij2 opened this issue Aug 23, 2016 · 1 comment

Comments

@muschellij2
Copy link

If you run (duplicated lines intentional):

library(swirl)
install_course_github("seankross", "AdvDataSci_Part_1")
install_course_github("seankross", "AdvDataSci_Part_1")

you get a warning about the directory not empty. It may be useful to add:

course_path = file.path(swirl_courses_dir(), course_name)
if (dir.exists(course_path) & overwrite) {
     unlink(course_path, recursive = TRUE)
}
file.rename(file.path(swirl_courses_dir(), old_name), 
            course_path)
@elinw
Copy link

elinw commented Aug 26, 2016

This is related to the problem with unlink() that is mentioned in my pull request When unlink() fails it returns a 1 silently and the success message is given because the failure is not caught. Everywhere that unlink() is used it should be checked for an error before moving on. #522

Also this relates to
swirldev/swirlify#22

Which for some reason I put in swirlify, but it's really swirl install that has the issue of requiring uninstall to update.

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

No branches or pull requests

3 participants