Skip to content

Commit 1793efc

Browse files
committed
Expose source path
Signed-off-by: Robrecht Cannoodt <[email protected]>
1 parent b1083c3 commit 1793efc

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

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

Lines changed: 1 addition & 1 deletion
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, path)
1943+
def holder = new FileHolder(path, target)
19441944
files << holder
19451945
}
19461946
else {

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,31 +40,26 @@ class FileHolder {
4040

4141
final String stageName
4242

43-
final Path origPath
44-
45-
FileHolder( Path inputFile, Path origPath = null ) {
43+
FileHolder( Path inputFile ) {
4644
assert inputFile
4745
this.sourceObj = inputFile
4846
this.storePath = real(inputFile)
4947
this.stageName = norm(inputFile.getFileName())
50-
this.origPath = origPath
5148
}
5249

53-
FileHolder( def origin, Path path, Path origPath = null ) {
50+
FileHolder( def origin, Path path ) {
5451
assert origin != null
5552
assert path != null
5653

5754
this.sourceObj = origin
5855
this.storePath = path
5956
this.stageName = norm(path.getFileName())
60-
this.origPath = origPath
6157
}
6258

63-
protected FileHolder( def source, Path store, def stageName, Path origPath = null ) {
59+
protected FileHolder( def source, Path store, def stageName ) {
6460
this.sourceObj = source
6561
this.storePath = store
6662
this.stageName = norm(stageName)
67-
this.origPath = origPath
6863
}
6964

7065
FileHolder withName( def stageName ) {
@@ -75,7 +70,9 @@ class FileHolder {
7570

7671
String getStageName() { stageName }
7772

78-
Path getOrigPath() { origPath }
73+
Path getSourcePath() {
74+
sourceObj instanceof Path ? sourceObj : null
75+
}
7976

8077
@PackageScope
8178
static FileHolder get( def path, def name = null ) {

0 commit comments

Comments
 (0)