Skip to content

Commit 4e43b00

Browse files
committed
Experiment with opening github url
@jennybc: try it out and let me know what you think #93
1 parent 65764fa commit 4e43b00

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

R/github.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ use_github <- function(organisation = NULL,
136136
}
137137
git2r::branch_set_upstream(git2r::head(r), "origin/master")
138138

139-
done("View repo at ", create$html_url)
139+
view_url(create$html_url)
140140

141141
invisible(NULL)
142142
}

R/helpers.R

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,13 @@ edit_file <- function(base_path, path) {
183183
}
184184
invisible()
185185
}
186+
187+
view_url <- function(url, open = interactive()) {
188+
if (open) {
189+
done("Opening url")
190+
utils::browseURL(url)
191+
} else {
192+
todo("Open url ", url)
193+
}
194+
invisible()
195+
}

0 commit comments

Comments
 (0)