Coder Social home page Coder Social logo

matt-dray / ghdump Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 66 KB

:octocat::arrow_down: R package: download/clone all of a user's GitHub repositories for archiving purposes

Home Page: https://www.rostrum.blog/2020/06/14/ghdump/

License: Other

R 100.00%
r rstats package github-api gh purrr

ghdump's Issues

Correct `if` stop condition when downloading

The protocol argument check gets evaluated even when copy_type == "download" . It shouldn't. The !protocol %in% c("https", "ssh") in the if should only evaluate if copy_type == "clone" passes. So probably change & to && (preferred) or used nested ifs.

> ghdump::ghd_copy("co-analysis", "~/Desktop/co-analysis_copies", copy_type = "download")
Error in if (copy_type == "clone" & !protocol %in% c("https", "ssh")) { : 
  argument is of length zero

Better reporting of failure

Currently uses purrr::safely() in ghd_download_zips() in case a repo can't be download for whatever reason.

The failures are printed at the end of the output from ghd_download(), which is a poor user experience.

Can we get a see warnings() equivalent for reviewing the failures? Or at least cat() the failures.

In addition: Warning message:
In download.file(url = .x, destfile = paste0(dest_dir, "/", .y,  :
  cannot open URL 'https://codeload.github.com/matt-dray/2019-10-11-test-workshop/zip/master': HTTP status was '404 Not Found'

Better error handling

Just checks for character strings in ghd_download() right now. Need better coverage of conditions. Intermediate non-exported functions also need handling in case something weird is returned.

Allow for selection of HTTPS or SSH

Defaults to HTTPS iirc. Allow for SSH with a simple argument like protocol = c("https, "ssh") and ifelse some dependent paste statements.

Control which repos are downloaded

ghd_download() is only concerned with all repos.

  • Offer repo selection from this function?
  • Offer personal/private only (or both) if you are recognised as accessing your own repos

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.