Skip to content

Commit 4e0a285

Browse files
remove debugging
1 parent b547c85 commit 4e0a285

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

R/exec.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,14 @@ path_derive_precommit_exec_conda_impl <- function(conda_env) {
207207
{
208208
ls <- reticulate::conda_list()
209209
path_reticulate <- fs::path_dir(ls[ls$name == conda_env, "python"][1])
210-
cat("path_reticulate:", path_reticulate, "\n")
211210
derived <- fs::path(
212-
# if windows, this is r-precommit, otherwise, it's r-precommit/env and use just base directory
211+
# if windows, this is r-precommit, otherwise,
212+
# it's r-precommit/env and use just base directory
213213
path_reticulate,
214214
# if windows, append Scripts/
215215
ifelse(is_windows(), "Scripts", ""),
216216
precommit_executable_file()
217217
)
218-
cat("derived:", derived, "\n")
219218
unname(ifelse(file_exists(derived), derived, ""))
220219
},
221220
error = function(e) ""

R/install.R

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,14 @@ install_precommit <- function(force = FALSE) {
5555
#' @keywords internal
5656
install_impl <- function() {
5757
if (!"r-precommit" %in% reticulate::conda_list()$name) {
58-
reticulate::conda_create("r-precommit", python_version = "3.10")
58+
reticulate::conda_create("r-precommit")
5959
}
6060
reticulate::conda_install("r-precommit", packages = "pre-commit")
61-
# C:\Users\runneradmin\AppData\Local\r-miniconda\envs\r-precommit/python.exe
62-
# C:\\Users\\RUNNER~1\\AppData\\Local\\R-MINI~1\\envs\\r-precommit\\Scripts\\pre-commit.exe
63-
# stop(
64-
# "For debugging: these are files next to python executable ",
65-
# list.files("C:\\Users\\RUNNER~1\\AppData\\Local\\R-MINI~1\\envs\\r-precommit", pattern = 'pre-commit', recursive = TRUE)
66-
# )
6761
if (path_derive_precommit_exec_conda() == "") {
68-
base_dir <- grep("r-precommit", gsub("r-precommit.*", "r-precommit", reticulate::conda_list()$python, ), value = TRUE)[1]
62+
base_dir <- grep(
63+
"r-precommit", gsub("r-precommit.*", "r-precommit", reticulate::conda_list()$python, ),
64+
value = TRUE
65+
)[1]
6966
rlang::abort(c(
7067
paste0(
7168
"Please open an issue on https://github.com/lorenzwalthert/precommit and ",

0 commit comments

Comments
 (0)