Skip to content

Commit

Permalink
fix error in ct_migrate_cache towards better accounting for only one …
Browse files Browse the repository at this point in the history
…of the two dirs being present
  • Loading branch information
datapumpernickel committed May 23, 2024
1 parent 49c9297 commit d686025
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ ct_migrate_cache <- function(){
cli::cli_abort('x' = 'Something went wrong while copying.')
}

fs::dir_delete(rappdirs::user_cache_dir('comtradr'))

if(fs::dir_exists(rappdirs::user_cache_dir('comtradr'))){
fs::dir_delete(rappdirs::user_cache_dir('comtradr'))
}
## as above but for the bulk cache directory
if((rappdirs::user_cache_dir('comtradr_bulk')!=
tools::R_user_dir('comtradr_bulk', which = 'cache')) &&
Expand All @@ -85,7 +86,9 @@ ct_migrate_cache <- function(){
list.files(tools::R_user_dir('comtradr_bulk', which = 'cache')))){
cli::cli_abort('x' = 'Something went wrong while copying.')
}
fs::dir_delete(rappdirs::user_cache_dir('comtradr_bulk'))
if(fs::dir_exists(rappdirs::user_cache_dir('comtradr_bulk'))){
fs::dir_delete(rappdirs::user_cache_dir('comtradr_bulk'))
}
}

#' Get reference table from package data
Expand Down
1 change: 1 addition & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ASEAN
CMD
COMTRADE
Comtrade
Codecov
Comtrade
EB
Expand Down

0 comments on commit d686025

Please # to comment.