Skip to content

Commit 79b4b9e

Browse files
Merge pull request #455 from PredictiveEcology/makeRelative
makeRelative --> tweaks for Mac
2 parents 1f4f19c + 77f7e3e commit 79b4b9e

File tree

6 files changed

+9
-34
lines changed

6 files changed

+9
-34
lines changed

.vscode/extensions.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ SystemRequirements: 'unrar' (Linux/macOS) or '7-Zip' (Windows) to work with '.ra
1818
URL:
1919
https://reproducible.predictiveecology.org,
2020
https://github.com/PredictiveEcology/reproducible
21-
Date: 2025-12-11
22-
Version: 2.1.3.9000
21+
Date: 2025-12-16
22+
Version: 2.1.3.9001
2323
Authors@R:
2424
c(person(given = "Eliot J B",
2525
family = "McIntire",

R/paths.R

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,16 +370,13 @@ makeRelative <- function(files, absoluteBase) {
370370
if (length(files)) {
371371
areAbs <- isAbsolutePath(files)
372372
if (any(areAbs)) {
373+
files[areAbs] <- normPath(files[areAbs])
373374
absoluteBase <- normPath(absoluteBase) # can be "." which means 'any character' in a grep
374375
if (length(absoluteBase) < length(files))
375376
absoluteBase <- rep(absoluteBase, length.out = length(files))
376377
files[areAbs] <- unlist(Map(ab = absoluteBase[areAbs], file = files[areAbs], function(ab, file)
377378
gsub(paste0("^", ab, "/{0,1}"), "", file)
378379
))
379-
# files[areAbs] <- gsub(paste0("^", absoluteBase, "/{0,1}"), "", files[areAbs])
380-
381-
# this does dumb things when it is not relative ... i.e., with prepend ../../../../../..
382-
# files[areAbs] <- fs::path_rel(start = absoluteBase, files[areAbs])
383380
}
384381
}
385382
if (length(files)) {

air.toml

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/testthat/test-prepInputs.R

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,10 @@ test_that("lightweight tests 2 for code coverage", {
15291529
})
15301530

15311531
expect_error(extractFromArchive(theZapFile), "Archives of type zap are not currently supported")
1532-
expect_error(extractFromArchive(theZipName), "No archive exists with filename")
1532+
oo <- capture.output(
1533+
type = "message",
1534+
expect_error(extractFromArchive(theZipName), "No archive exists with filename")
1535+
)
15331536

15341537
extractFromArchive(theZipFile, neededFiles = character())
15351538

@@ -1547,14 +1550,15 @@ test_that("lightweight tests 2 for code coverage", {
15471550
# check Checksums fn
15481551

15491552
expect_error(
1553+
oo <- capture.output(type = "message",
15501554
suppressWarnings(extractFromArchive(
15511555
theZipFile,
15521556
neededFiles = character(),
15531557
checkSumFilePath = theRDSFile,
15541558
destinationPath = tmpdir
15551559
)),
15561560
"checkSumFilePath is not a CHECKSUMS.txt"
1557-
)
1561+
))
15581562

15591563
# Doubley nested zips -- extract inner, inner
15601564
a <- extractFromArchive(

0 commit comments

Comments
 (0)