Skip to content

Commit e1c50ce

Browse files
committed
fix repo cp when fn called 2nd time
1 parent da77809 commit e1c50ce

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: githist
22
Title: Code analyses traced along the 'git' history of a package
3-
Version: 0.1.0.025
3+
Version: 0.1.0.026
44
Authors@R:
55
person("Mark", "Padgham", , "mark.padgham@email.com", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0003-2172-5265"))

R/githist-fn.R

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ githist <- function (path, n = NULL, step_size = 1L) {
2727
checkmate::assert_int (n, lower = 1L)
2828
}
2929

30-
path_cp <- path
30+
path_cp <- fs::path (fs::path_temp (), basename (path))
3131
clean_after <- FALSE
32-
if (fs::path (fs::path_dir (path)) != fs::path_temp ()) {
32+
if (fs::path (fs::path_dir (path)) != fs::path_temp () &&
33+
!fs::dir_exists (path_cp)) {
3334
path_cp <- fs::dir_copy (path, fs::path_temp ())
3435
clean_after <- TRUE
3536
}

codemeta.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"codeRepository": "https://github.com/ropensci-review-tools/githist",
99
"issueTracker": "https://github.com/ropensci-review-tools/githist/issues",
1010
"license": "https://spdx.org/licenses/GPL-3.0",
11-
"version": "0.1.0.025",
11+
"version": "0.1.0.026",
1212
"programmingLanguage": {
1313
"@type": "ComputerLanguage",
1414
"name": "R",

0 commit comments

Comments
 (0)