-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from NEONScience/saveunzipped
allow user to remove unzipped monthly folders by request
Showing
7 changed files
with
61 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
############################################################################################## | ||
#' @title Clean up folder after stacking | ||
|
||
#' @author | ||
#' Christine Laney \email{claney@battelleecology.org} | ||
|
||
#' @description | ||
#' Remove unzipped monthly data folders | ||
#' | ||
#' @keywords internal | ||
#' @param folder The file path to the folder that needs to be cleaned up (the root directory of the data package) | ||
#' @return Any existing directory except for stackedFiles will be removed. Nothing is returned. | ||
|
||
#' @references | ||
#' License: GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 | ||
|
||
# Changelog and author contributions / copyrights | ||
# Christine Laney (2018-01-10) | ||
############################################################################################## | ||
cleanUp <- function(folder) { | ||
dirs <- list.dirs(folder, recursive = FALSE) | ||
dirsNotStacked <- dirs[-grep(pattern = "stackedFiles", x = dirs)] | ||
if(length(dirsNotStacked) > 0) {unlink(dirsNotStacked, recursive = TRUE)} | ||
writeLines("All unzipped monthly data folders have been removed.") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.