From 4e5edf0764df94aaf85609cc16e580ccac1c82ae Mon Sep 17 00:00:00 2001 From: "Dr. Ernie Prabhakar" <19791+drernie@users.noreply.github.com> Date: Wed, 4 Sep 2024 21:21:17 -0700 Subject: [PATCH] osSep --- .../src/main/nextflow/quilt/jep/QuiltPackage.groovy | 2 +- .../src/main/nextflow/quilt/nio/QuiltPath.groovy | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy b/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy index be5e19cb..7b6b5bb9 100644 --- a/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy +++ b/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy @@ -153,7 +153,7 @@ class QuiltPackage { */ List relativeChildren(String subpath) { Path subfolder = folder.resolve(subpath) - String base = subfolder.toString() + '/' + String base = subfolder.toString() + QuiltPath.osSep() List result = [] final String[] children = subfolder.list().sort() //log.debug("relativeChildren[${base}] $children") diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltPath.groovy b/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltPath.groovy index a1b94650..4e5b69e0 100644 --- a/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltPath.groovy +++ b/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltPath.groovy @@ -46,8 +46,12 @@ final class QuiltPath implements Path, Comparable { private final String[] paths private final boolean isFileName - static String joinOs(String... parts) { - return parts.join(FileSystems.getDefault().getSeparator()) + static String osSep() { + return FileSystems.getDefault().getSeparator() + } + + static String osJoin(String... parts) { + return parts.join(osSep()) } QuiltPath(QuiltFileSystem filesystem, QuiltParser parsed, boolean isFileName = false) { @@ -219,7 +223,7 @@ final class QuiltPath implements Path, Comparable { Path relativize(Path other) { if (this == other) { return null } String file = (other in QuiltPath) ? ((QuiltPath)other).localPath() : other.toString() - String base = joinOs(pkg().toString(), parsed.getPath()) + String base = osJoin(pkg().toString(), parsed.getPath()) println("relativize[$base] in [$file]") int i = file.indexOf(base) if (i < 1) {