Skip to content

Commit 5002f56

Browse files
psafontmr-c
authored andcommitted
style: remove link location code (#926)
1 parent 15473bf commit 5002f56

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

cwltool/process.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -343,40 +343,6 @@ def _check_adjust(a_file):
343343

344344
visit_class(outputObj, ("File", "Directory"), _check_adjust)
345345

346-
# If there are symlinks to intermediate output directories, we want to move
347-
# the real files into the final output location. If a file is linked more than once,
348-
# make an internal relative symlink.
349-
def relink(relinked, # type: Dict[Text, Text]
350-
root_path # type: Text
351-
):
352-
for dir_entry in scandir(root_path):
353-
path = dir_entry.path
354-
if os.path.islink(path):
355-
real_path = os.path.realpath(path)
356-
if real_path in relinked:
357-
link_name = relinked[real_path]
358-
if onWindows():
359-
if os.path.isfile(path):
360-
shutil.copy(os.path.relpath(link_name, path), path)
361-
elif os.path.exists(path) and os.path.isdir(path):
362-
shutil.rmtree(path)
363-
copytree_with_merge(os.path.relpath(link_name, path), path)
364-
else:
365-
os.unlink(path)
366-
os.symlink(os.path.relpath(link_name, path), path)
367-
else:
368-
if any(os.path.commonprefix([path, real_path]) == path
369-
for path in source_directories):
370-
os.unlink(path)
371-
os.rename(real_path, path)
372-
relinked[real_path] = path
373-
if os.path.isdir(path):
374-
relink(relinked, path)
375-
376-
if action == "move":
377-
relinked = {} # type: Dict[Text, Text]
378-
relink(relinked, destination_path)
379-
380346
if compute_checksum:
381347
visit_class(outputObj, ("File",), functools.partial(
382348
compute_checksums, fs_access))

0 commit comments

Comments
 (0)