You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
stopifnot(`'authors' must be of class 'person'`= inherits(authors, "person"))
37
+
38
+
# Handling retrocompatibility
39
+
40
+
# Case 1 : old author params are not null
41
+
any_author_params_is_not_null<- all(
42
+
vapply(
43
+
list(
44
+
author_first_name,
45
+
author_last_name,
46
+
author_email,
47
+
author_orcid
48
+
), is.null, logical(1)
49
+
)
50
+
)
51
+
52
+
if (!any_author_params_is_not_null) {
53
+
warning("The `author_first_name`, `author_last_name`, `author_email` and `author_orcid` parameters will be deprecated from fill_desc() in the next version of {golem}. \nPlease use the `authors` parameter instead.\nSee ?person for more details on how to use it.")
54
+
# Case 1.1 : old author params are null and authors is empty
55
+
if (length(authors) ==0) {
56
+
# We use the old author params to fill the DESCRIPTION file
57
+
cli_cli_alert_info(
58
+
"the `authors` argument is empty, using `author_first_name`, `author_last_name`, `author_email` and `author_orcid` to fill the DESCRIPTION file."
59
+
)
60
+
authors<- person(
61
+
given=author_first_name,
62
+
family=author_last_name,
63
+
email=author_email,
64
+
role=NULL,
65
+
comment= c(ORCID=author_orcid)
66
+
)
67
+
} else {
68
+
# Case 1.2, old author params are null and authors is not empty
69
+
# We keep the authors as is
70
+
cli_cli_alert_info(
71
+
"the `authors` argument is not empty, using it to fill the DESCRIPTION file, the old author params are ignored."
72
+
)
73
+
}
74
+
}
75
+
# the else here is the case 2 : old author params are null and authors is set, we keep the authors as is
0 commit comments