mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-21 12:54:26 +02:00
Improve path handling of the js style-checker.
This commit is contained in:
parent
5e70dfb87e
commit
7c779bc525
@ -91,25 +91,28 @@ def main():
|
|||||||
command_options.append('--verbose')
|
command_options.append('--verbose')
|
||||||
if options.verbose:
|
if options.verbose:
|
||||||
command_options.append('--show-non-errors')
|
command_options.append('--show-non-errors')
|
||||||
|
path_args = [arguments.remove(a) or a
|
||||||
|
for a in arguments[:len(arguments)]
|
||||||
|
if os.path.isfile(a) or os.path.isdir(a)]
|
||||||
|
if not path_args:
|
||||||
|
path_args = ['../../application', '../../bin', '../../library/Icinga']
|
||||||
if options.exclude:
|
if options.exclude:
|
||||||
pass # TODO: Preprocess disallowed files/directories
|
pass # TODO: Preprocess disallowed files/directories
|
||||||
elif options.include:
|
elif options.include:
|
||||||
pass # TODO: Preprocess allowed files/directories
|
pass # TODO: Preprocess allowed files/directories
|
||||||
else:
|
|
||||||
arguments.extend(['../../application', '../../bin',
|
|
||||||
'../../library/Icinga'])
|
|
||||||
|
|
||||||
# Application invocation..
|
# Application invocation..
|
||||||
if options.build:
|
if options.build:
|
||||||
result_data = execute_command([application_path] + DEFAULT_ARGS +
|
result_data = execute_command([application_path] + DEFAULT_ARGS +
|
||||||
command_options + arguments, True)
|
command_options + arguments +
|
||||||
|
path_args, True)
|
||||||
result_path = os.path.join(get_report_directory(),
|
result_path = os.path.join(get_report_directory(),
|
||||||
'jshint_results.xml')
|
'jshint_results.xml')
|
||||||
with open(result_path, 'w') as result_file:
|
with open(result_path, 'w') as result_file:
|
||||||
result_file.write(result_data)
|
result_file.write(result_data)
|
||||||
else:
|
else:
|
||||||
execute_command([application_path] + DEFAULT_ARGS +
|
execute_command([application_path] + DEFAULT_ARGS +
|
||||||
command_options + arguments)
|
command_options + arguments + path_args)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user