Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

desc_get_built() reads multiples lines #153

Merged
merged 4 commits into from
Aug 28, 2024

Conversation

seankross
Copy link
Contributor

Fixes #145

Copy link
Member

@krlmlr krlmlr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I like your test case, could we simplify the logic?

R/built.R Outdated Show resolved Hide resolved
@krlmlr
Copy link
Member

krlmlr commented Aug 15, 2024

Could be as simple as replacing $get() with $get_field() :

writeLines(
  c(
    "Type: package",
    "Built: R 3.4.1; x86_64-apple-darwin15.6.0;\n  2017-09-14 20:30:19 UTC; unix"
  ),
  "DESCRIPTION"
)

desc <- desc::desc(file = "DESCRIPTION")

desc$get("Built")
#>                                                                  Built 
#> "R 3.4.1; x86_64-apple-darwin15.6.0;\n  2017-09-14 20:30:19 UTC; unix"
desc$get_field("Built")
#> [1] "R 3.4.1; x86_64-apple-darwin15.6.0; 2017-09-14 20:30:19 UTC; unix"

Created on 2024-08-16 with reprex v2.1.0

@gaborcsardi
Copy link
Member

Thank you!

@gaborcsardi gaborcsardi merged commit a7246c9 into r-lib:main Aug 28, 2024
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

get_built() fails if Built is not a single line
3 participants