Skip to content

Commit 4e084ea

Browse files
Vladimir Kotalahornace
authored andcommitted
allow directory in commands
1 parent e62b1e2 commit 4e084ea

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

tools/src/main/python/opengrok_tools/utils/mirror.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,8 @@ def check_commands(commands):
607607
format(name, COMMANDS_PROPERTY, value))
608608
return False
609609

610-
if not os.path.isfile(value):
611-
logger.error("path for '{}' under '{}' is not a file: {}".
610+
if not os.path.isfile(value) and not os.path.isdir(value):
611+
logger.error("path for '{}' under '{}' is not a file or directory: {}".
612612
format(name, COMMANDS_PROPERTY, value))
613613
return False
614614

tools/src/test/python/test_mirror.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ def test_configuration_commands():
132132
assert check_configuration(config)
133133

134134

135+
@posix_only
136+
def test_configuration_commands_dir():
137+
config = {COMMANDS_PROPERTY: {"teamware": "/usr/bin"}}
138+
assert check_configuration(config)
139+
140+
135141
@posix_only
136142
def test_invalid_project_config_nonexec_hook():
137143
with tempfile.TemporaryDirectory() as tmpdir:

0 commit comments

Comments
 (0)