Skip to content

Commit

Permalink
fix Windows paths
Browse files Browse the repository at this point in the history
  • Loading branch information
drernie committed Sep 8, 2024
1 parent 73b68b3 commit cf6b077
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 0 additions & 4 deletions plugins/nf-quilt/src/main/nextflow/quilt/QuiltObserver.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,11 @@ class QuiltObserver implements TraceObserver {

String workRelative(Path src) {
Path source = src.toAbsolutePath().normalize()
log.debug("workRelative.source: $source [type: ${source.getClass()}]")
Path workDir = session.workDir.toAbsolutePath().normalize()
log.debug("workRelative.workDir: $workDir [type: ${workDir.getClass()}]")
try {
Path subPath = workDir.relativize(source)
log.debug("workRelative.subPath: $subPath]")
// drop first two components, which are the workDir
Path relPath = subPath.subpath(2, subPath.getNameCount())
log.debug("workRelative.relPath: $relPath]")
return relPath.toString()
} catch (IllegalArgumentException e) {
log.error("workRelative.fallback: $e")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package nextflow.quilt.nio

import nextflow.quilt.QuiltSpecification
import nextflow.quilt.QuiltObserver
import nextflow.quilt.jep.QuiltPackage
import nextflow.Session

import java.nio.file.Path
Expand Down Expand Up @@ -90,7 +91,7 @@ class QuiltObserverTest extends QuiltSpecification {
expect:
String relPath = observer.workRelative(source)
println("relPath: $relPath")
relPath == subPath
relPath == QuiltPackage.osConvert(subPath)
println('done')
}

Expand Down Expand Up @@ -136,7 +137,7 @@ class QuiltObserverTest extends QuiltSpecification {
given:
QuiltObserver observer = makeObserver()
expect:
observer.session.workDir.toString() == './work'
observer.session.workDir.toString() == QuiltPackage.osConvert('./work')
rc == observer.canOverlayPath(Paths.get(path), Paths.get(path))
where:
rc | path
Expand Down

0 comments on commit cf6b077

Please sign in to comment.