Skip to content

Commit c9fe7fe

Browse files
committed
Use command
1 parent f79b1c4 commit c9fe7fe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/reuse_skip_wrapper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import argparse
88
import os
9+
import shutil
910
import subprocess
1011

1112

@@ -27,9 +28,8 @@ def skip(file: str) -> bool:
2728

2829
files = [f for f in args.files if not skip(f)]
2930

30-
# Check if reuse is installed in ~/.local/bin otherwise try to use python -m reuse
31-
reuse_path = os.path.expanduser("~/.local/bin/reuse")
32-
if not os.path.isfile(reuse_path):
31+
reuse_path = shutil.which("reuse")
32+
if not reuse_path:
3333
reuse_path = "python -m reuse"
3434
try:
3535
subprocess.run(f"{reuse_path} lint-file {' '.join(files)}", shell = True, check = True)

0 commit comments

Comments
 (0)