Skip to content

Commit b18e055

Browse files
author
Arni Magnusson
committed
Parse @ref first, then owner/repo/subdir
1 parent 76bc099 commit b18e055

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: icesTAF
22
Version: 3.3-1
3-
Date: 2019-12-06
3+
Date: 2019-12-11
44
Title: Functions to Support the ICES Transparent Assessment Framework
55
Authors@R: c(person("Arni", "Magnusson", role=c("aut","cre"), email="[email protected]"),
66
person("Colin", "Millar", role="aut"),

NEWS

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
--------------------------------------------------------------------------------
2-
icesTAF 3.3-1 (2019-12-06)
2+
icesTAF 3.3-1 (2019-12-11)
33
--------------------------------------------------------------------------------
44
o Improved handling of SOFTWARE.bib GitHub entries that have owner/repo/subdir.
5+
Code contributed by Ibrahim Umar.
56

67
o Improved process.bib() so it verifies that 'access' values match the allowed
78
values.

R/parse.repo.R

+8-7
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88

99
parse.repo <- function(repo)
1010
{
11-
x <- unlist(strsplit(repo, "/"))
12-
13-
username <- head(x, 1)
14-
repo.ref <- tail(x, 1)
15-
subdir <- if(length(x) == 2) "" else unlist(strsplit(x[3], "@"))[1]
11+
## 1 Read ref, then remove @reference tail
12+
ref <- if(grepl("@",repo)) unlist(strsplit(repo,"@"))[2] else ""
13+
repo <- sub("@.*", "", repo)
1614

17-
repo <- if(length(x) == 2) unlist(strsplit(repo.ref, "@"))[1] else x[2]
18-
ref <- if(grepl("@", repo.ref)) unlist(strsplit(repo.ref, "@"))[2] else ""
15+
## 2 Read username, repo, subdir
16+
x <- unlist(strsplit(repo, "/"))
17+
username <- x[1]
18+
repo <- x[2]
19+
subdir <- if(length(x) > 2) paste(x[-c(1,2)],collapse="/") else ""
1920

2021
list(username=username, repo=repo, subdir=subdir, ref=ref)
2122
}

0 commit comments

Comments
 (0)