Skip to content

Commit b3d4fe0

Browse files
committed
add origPath as an argument to FileHolder
Signed-off-by: Robrecht Cannoodt <[email protected]>
1 parent 36153c6 commit b3d4fe0

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

modules/nextflow/src/main/groovy/nextflow/processor/TaskProcessor.groovy

+1-1
Original file line numberDiff line numberDiff line change
@@ -1940,7 +1940,7 @@ class TaskProcessor {
19401940
if( item instanceof Path || coerceToPath ) {
19411941
def path = normalizeToPath(item)
19421942
def target = executor.isForeignFile(path) ? batch.addToForeign(path) : path
1943-
def holder = new FileHolder(target)
1943+
def holder = new FileHolder(target, path)
19441944
files << holder
19451945
}
19461946
else {

modules/nf-commons/src/main/nextflow/file/FileHolder.groovy

+10-3
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,31 @@ class FileHolder {
4040

4141
final String stageName
4242

43-
FileHolder( Path inputFile ) {
43+
final Path origPath
44+
45+
FileHolder( Path inputFile, Path origPath = null ) {
4446
assert inputFile
4547
this.sourceObj = inputFile
4648
this.storePath = real(inputFile)
4749
this.stageName = norm(inputFile.getFileName())
50+
this.origPath = origPath
4851
}
4952

50-
FileHolder( def origin, Path path ) {
53+
FileHolder( def origin, Path path, Path origPath = null ) {
5154
assert origin != null
5255
assert path != null
5356

5457
this.sourceObj = origin
5558
this.storePath = path
5659
this.stageName = norm(path.getFileName())
60+
this.origPath = origPath
5761
}
5862

59-
protected FileHolder( def source, Path store, def stageName ) {
63+
protected FileHolder( def source, Path store, def stageName, Path origPath = null ) {
6064
this.sourceObj = source
6165
this.storePath = store
6266
this.stageName = norm(stageName)
67+
this.origPath = origPath
6368
}
6469

6570
FileHolder withName( def stageName ) {
@@ -70,6 +75,8 @@ class FileHolder {
7075

7176
String getStageName() { stageName }
7277

78+
Path getOrigPath() { origPath }
79+
7380
@PackageScope
7481
static FileHolder get( def path, def name = null ) {
7582
Path storePath = path as Path

0 commit comments

Comments
 (0)