Skip to content

Commit

Permalink
[R-package] added command to remove build/ dir in install.libs.R
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Mar 14, 2020
1 parent eda4d64 commit 59e3721
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion R-package/src/install.libs.R
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,18 @@ if (!use_precompile) {
dest <- file.path(R_PACKAGE_DIR, paste0("libs", R_ARCH), fsep = "/")
dir.create(dest, recursive = TRUE, showWarnings = FALSE)
if (file.exists(src)) {
cat("Found library file: ", src, " to move to ", dest, sep = "")
print(paste0("Found library file: ", src, " to move to ", dest))
file.copy(src, dest, overwrite = TRUE)
} else {
stop(paste0("Cannot find lib_lightgbm", SHLIB_EXT))
}

# clean up the "build" directory
if (dir.exists(build_dir)){
print("Removing 'build/' directory")
unlink(
x = file.path(R_PACKAGE_SOURCE, "src", "build")
, recursive = TRUE
, force = TRUE
)
}

0 comments on commit 59e3721

Please sign in to comment.