Skip to content

Commit

Permalink
Handle both file and folder when getting source LicenseRef
Browse files Browse the repository at this point in the history
  • Loading branch information
sgaist committed Apr 27, 2023
1 parent 624ed66 commit ca9521d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/reuse/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ def put_license_in_file(
result = input().strip()
out.write("\n")
if result:
source = Path(result) / "".join((spdx_identifier, ".txt"))
source = Path(result)
if source.is_dir():
source = source / "".join((spdx_identifier, ".txt"))
shutil.copyfile(source, destination)
else:
text = download_license(spdx_identifier)
Expand Down

0 comments on commit ca9521d

Please sign in to comment.