Commit b5be10a 1 parent 347f9e2 commit b5be10a Copy full SHA for b5be10a
File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ download_tzdata_on_windows <- function(tzdir = NULL) {
37
37
38
38
# Check if the file exists
39
39
if (! file.exists(tzdata_compressed )) {
40
- stop (" Failed to download the timezone database." )
40
+ cli :: cli_abort (" Failed to download the timezone database." )
41
41
}
42
42
43
43
# Extract the tar.gz file
@@ -50,6 +50,17 @@ download_tzdata_on_windows <- function(tzdir = NULL) {
50
50
)
51
51
windows_zones_path <- file.path(tzdata_path , " windowsZones.xml" )
52
52
utils :: download.file(windows_zones_url , windows_zones_path , mode = " wb" )
53
+
54
+ # Find the "northamerica" file and replace "April" with "Apr"
55
+ northamerica_file <- file.path(tzdata_path , " northamerica" )
56
+ if (file.exists(northamerica_file )) {
57
+ file_contents <- readLines(northamerica_file )
58
+ file_contents <- gsub(" April" , " Apr" , file_contents )
59
+ writeLines(file_contents , northamerica_file )
60
+ } else {
61
+ cli :: cli_warn(" northamerica file not found in tzdata_path" )
62
+ }
63
+
53
64
return (tzdata_path )
54
65
}
55
66
You can’t perform that action at this time.
0 commit comments