You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
750B

  1. #' Install gathertweet exectuable script
  2. #'
  3. #' Installs the `gatherwteet` executable script to the location. Should work
  4. #' with Unix and MacOS out of the box, but I can't make any guarantees about
  5. #' Windows.
  6. #'
  7. #' @param location Where to install the gathertweet executable script
  8. #' @export
  9. install_gathertweet <- function(
  10. location = "/usr/local/bin"
  11. ) {
  12. if (!dir_exists(location)) {
  13. log_fatal("Location {location} does not exist")
  14. }
  15. if (!fs::file_access(location, "write")) {
  16. log_fatal("You do not have write permissions for {location}")
  17. }
  18. log_info("Creating link to gathertweet at {location}/gathertweet")
  19. fs::link_create(
  20. system.file("gathertweet.R", package = "gathertweet"),
  21. path(location, "gathertweet")
  22. )
  23. }