Skip to content

Commit a2186c5

Browse files
authored
Normalize versions to package_versions before comparison (#1227)
Closes #1189 To handle sf 1.1-1 and convert it to 1.1.1, which is the form `packageVersion()` returns A bit tricky to actually write a test for this, as I don't really want to install sf on every test run. But a manual check confirms that you can goto definition on `sf::as_Spatial()` now
1 parent bd462d3 commit a2186c5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

crates/oak_sources/scripts/srcrefs.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ if (length(path) == 0L) {
3333
quit(status = 1L)
3434
}
3535

36-
# Make sure installed version matches the requested version
36+
# Make sure installed version matches the requested version.
37+
# Normalize both to `package_version`s to handle versions like sf's 1.1-1.
38+
version <- as.character(package_version(version))
3739
installed_version <- as.character(packageVersion(package))
3840
if (installed_version != version) {
3941
message(paste0(

0 commit comments

Comments
 (0)