Skip to content

Commit 8edd25b

Browse files
authored
Bug fix to use both abspath and relpath
2 parents c1e8af6 + 462c17d commit 8edd25b

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
python-debian==0.1.40
12
binaryornot
23
requests
34
reuse

src/fosslight_reuse/_add.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def set_missing_license_copyright(missing_license_filtered, missing_copyright_fi
116116
logger.info("# Missing license File(s) ")
117117
for lic_file in sorted(missing_license_filtered):
118118
logger.info(f" * {lic_file}")
119-
missing_license_list.append(path_to_find + '/' + lic_file)
119+
missing_license_list.append(lic_file)
120120

121121
if license == "" and copyright == "":
122122
input_license = input_license_while_running()
@@ -140,7 +140,7 @@ def set_missing_license_copyright(missing_license_filtered, missing_copyright_fi
140140
logger.info("# Missing Copyright File(s) ")
141141
for cop_file in sorted(missing_copyright_filtered):
142142
logger.info(f" * {cop_file}")
143-
missing_copyright_list.append(os.getcwd() + '/' + path_to_find + '/' + cop_file)
143+
missing_copyright_list.append(cop_file)
144144

145145
if license == "" and copyright == "":
146146
input_copyright = input_copyright_while_running()
@@ -195,6 +195,9 @@ def add_content(path_to_find, file, input_license="", input_copyright=""):
195195

196196
if path_to_find == "":
197197
path_to_find = os.getcwd()
198+
else:
199+
path_to_find = os.path.abspath(path_to_find)
200+
os.chdir(path_to_find)
198201

199202
now = datetime.now().strftime('%Y%m%d_%H-%M-%S')
200203
output_dir = os.getcwd()

tox.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ basepython= python3.6
1010
whitelist_externals = cat
1111
cp
1212
rm
13-
git
1413
setenv =
1514
PYTHONPATH=.
1615

@@ -32,7 +31,6 @@ commands =
3231
cp -r tests/add tests/add_result
3332
fosslight_reuse add -p tests/add_result -c "2019-2021 LG Electronics Inc." -l "GPL-3.0-only"
3433
rm -rf reuse_example
35-
git clone https://github.com/LGE-OSS/example.git reuse_example
3634
[testenv:release]
3735
deps =
3836
-r{toxinidir}/requirements-dev.txt

0 commit comments

Comments
 (0)