Skip to content

Commit 46a4cbd

Browse files
committed
fix windows build
1 parent 477ce40 commit 46a4cbd

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

R/read_shp.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ read_shp <- function(path, layer = NULL) {
6565

6666
# Auto-detect layer if not specified
6767
if (is.null(layer)) {
68-
layers <- sf::st_layers(dsn)$name
68+
layers <- sort(sf::st_layers(dsn)$name)
6969
if (length(layers) == 0) {
7070
cli::cli_abort("No layers found at {.path {path}}.")
7171
} else if (length(layers) > 1) {

tests/testthat/_snaps/read_shp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Condition
66
Warning:
77
Multiple layers found in '<tempdir>'.
8-
i Using the first layer: "b".
8+
i Using the first layer: "a".
99

1010
# read_shp errors when no layers are found
1111

0 commit comments

Comments
 (0)