forked from r-lib/usethis
/
manual-pr-functions.R
63 lines (45 loc) 路 1.14 KB
/
manual-pr-functions.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
devtools::load_all("~/rrr/usethis")
pkgname <- "grumpy-llama"
(pkgpath <- path_temp(pkgname))
create_local_package(pkgpath)
proj_sitrep()
# say YES to the commit
use_git()
# say YES to the commit
use_github(private = TRUE)
# no non-default branches
pr_resume()
# should exit w/ no big fuss
# no open PRs
pr_fetch()
# should exit w/ no big fuss
pr_init("feature")
use_readme_md(open = FALSE)
gert::git_add("README.md")
gert::git_commit("Add README")
pr_view()
# doesn't work, because current branch no yet associated with a PR
pr_pause()
pr_resume()
# offers to switch to the single existing branch
# remember to actually create the PR in the browser
pr_push()
pr_view()
browse_github_pulls()
pr_fetch()
# presents my one existing PR (the branch I'm on), which I can select
pr_pause()
pr_resume()
# agree to the commit (or not, depending on what you want to test)
use_news_md(open = FALSE)
pr_finish()
# restore initial project, working directory, delete local repo
withr::deferred_run()
## delete local and remote repo
(gh_account <- gh::gh_whoami())
pkgname
gh::gh(
"DELETE /repos/:username/:pkg",
username = gh_account$login,
pkg = pkgname
)