Refactor symlink usage to support Windows

This commit is contained in:
James R. Barlow
2019-12-04 17:13:51 -08:00
parent 17c419dfcb
commit 72d3ee3a87
6 changed files with 20 additions and 13 deletions
+2 -2
View File
@@ -42,7 +42,7 @@ from .exec import (
tesseract,
unpaper,
)
from .helpers import is_file_writable, is_iterable_notstr, monotonic, re_symlink
from .helpers import is_file_writable, is_iterable_notstr, monotonic, safe_symlink
# -------------
# External dependencies
@@ -374,7 +374,7 @@ def create_input_file(options, work_folder):
else:
try:
target = os.path.join(work_folder, 'origin')
re_symlink(options.input_file, target)
safe_symlink(options.input_file, target)
return target
except FileNotFoundError:
raise InputFileError(f"File not found - {options.input_file}")