Skip to content

Commit 3b7fcd0

Browse files
committed
Fix --check for published-not-linked files.
Resolves #21.
1 parent 8a09987 commit 3b7fcd0

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

rimport

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,15 @@ def stage_data(
210210
dst = staging_root / rel
211211

212212
if dst.exists():
213-
logger.info("File is already published but NOT linked; linking now.")
214-
replace_one_file_with_symlink(inputdata_root, staging_root, str(src))
215-
print_can_file_be_downloaded(can_file_be_downloaded(rel, staging_root))
216-
check_relink_worked(src, dst)
213+
msg = "File is already published but NOT linked"
214+
if check:
215+
logger.info("%s; would link.", msg)
216+
print_can_file_be_downloaded(can_file_be_downloaded(rel, staging_root))
217+
else:
218+
logger.info("%s; linking now.", msg)
219+
replace_one_file_with_symlink(inputdata_root, staging_root, str(src))
220+
check_relink_worked(src, dst)
221+
print_can_file_be_downloaded(can_file_be_downloaded(rel, staging_root))
217222
return
218223

219224
if check:

0 commit comments

Comments
 (0)