@@ -32,18 +32,22 @@ source_files_s3 |> lapply(function(x) {
32
32
33
33
# MAIN LOOP
34
34
35
+ print(paste0(" Downloading " , x , " from s3://" , s3_bucket_name ))
36
+
35
37
file_name <- basename(x )
36
38
file_path <- paste0(data_dir , " /" , source_prefix , " /" , file_name )
37
39
40
+ system(paste0(" touch " , file_path ))
41
+
38
42
cori.db :: get_s3_object(s3_bucket_name , x , file_path ) # <= `x` includes source_prefix (i.e. "source")
39
43
40
44
print(paste0(" Finished downloading " , file_path ))
41
45
42
46
release_name <- gsub(" .zip" , " " , basename(file_path ))
43
47
release_dir <- paste0(data_dir , " /" , release_name )
44
48
45
- print(paste0(" Unzip release contents to " , release_dir ))
46
49
dir.create(release_dir , recursive = TRUE , showWarnings = FALSE )
50
+ print(paste0(" Unzip release contents to " , release_dir ))
47
51
48
52
unzip_command <- sprintf(" unzip -u %s -d %s" , file_path , release_dir )
49
53
print(unzip_command )
@@ -115,6 +119,9 @@ source_files_s3 |> lapply(function(x) {
115
119
# # Write csv state tables by release to a "clean" subdirectory (states)
116
120
file_name <- gsub(" _us_" , paste0(" _" , tolower(st_abbr ), " _" ), file_name )
117
121
file_path <- paste0(clean_states_dir , " /" , file_name )
122
+
123
+ system(paste0(" touch " , file_path ))
124
+
118
125
result <- data.table :: fwrite(dt_st , file_path )
119
126
120
127
stopifnot(file.exists(file_path ))
0 commit comments