Skip to content

Commit 79c2c8a

Browse files
plugin: don't try to copy file onto itself (#13)
If the command generates the artifact in the right place, there's no need to copy it to out directory Closes #8 Co-authored-by: hydrargyrum <[email protected]>
1 parent 592da44 commit 79c2c8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hatch_build_scripts/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def initialize(
6464
src_file = work_dir / work_file
6565
out_file = out_dir / work_file
6666
log.debug("Copying %s to %s", src_file, out_file)
67-
if src_file not in created:
67+
if src_file not in created and src_file != out_file:
6868
out_file.parent.mkdir(parents=True, exist_ok=True)
6969
shutil.copyfile(src_file, out_file)
7070
shutil.copystat(src_file, out_file)

0 commit comments

Comments
 (0)