Skip to content

Commit

Permalink
osSep
Browse files Browse the repository at this point in the history
  • Loading branch information
drernie committed Sep 5, 2024
1 parent 5fedd66 commit 4e5edf0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class QuiltPackage {
*/
List<String> relativeChildren(String subpath) {
Path subfolder = folder.resolve(subpath)
String base = subfolder.toString() + '/'
String base = subfolder.toString() + QuiltPath.osSep()
List<String> result = []
final String[] children = subfolder.list().sort()
//log.debug("relativeChildren[${base}] $children")
Expand Down
10 changes: 7 additions & 3 deletions plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltPath.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 4e5edf0

Please sign in to comment.