mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-07 09:58:54 +00:00
Merge pull request #696 from marpaia/fix-695
ignore ds_store on table generation
This commit is contained in:
commit
0cc4e0a287
@ -4,7 +4,7 @@
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the BSD-style license found in the
|
||||
# LICENSE file in the root directory of this source tree. An additional grant
|
||||
# LICENSE file in the root directory of this source tree. An additional grant
|
||||
# of patent rights can be found in the PATENTS file in the same directory.
|
||||
|
||||
from __future__ import absolute_import
|
||||
@ -269,18 +269,19 @@ def main(argc, argv):
|
||||
filename = argv[1]
|
||||
output = argv[2]
|
||||
|
||||
# Adding a 3rd parameter will enable the blacklist
|
||||
disable_blacklist = argc > 3
|
||||
if filename.endswith(".table"):
|
||||
# Adding a 3rd parameter will enable the blacklist
|
||||
disable_blacklist = argc > 3
|
||||
|
||||
setup_templates(filename)
|
||||
with open(filename, "rU") as file_handle:
|
||||
tree = ast.parse(file_handle.read())
|
||||
exec(compile(tree, "<string>", "exec"))
|
||||
blacklisted = is_blacklisted(table.table_name, path=filename)
|
||||
if not disable_blacklist and blacklisted:
|
||||
table.blacklist(output)
|
||||
else:
|
||||
table.generate(output)
|
||||
setup_templates(filename)
|
||||
with open(filename, "rU") as file_handle:
|
||||
tree = ast.parse(file_handle.read())
|
||||
exec(compile(tree, "<string>", "exec"))
|
||||
blacklisted = is_blacklisted(table.table_name, path=filename)
|
||||
if not disable_blacklist and blacklisted:
|
||||
table.blacklist(output)
|
||||
else:
|
||||
table.generate(output)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(len(sys.argv), sys.argv)
|
||||
|
Loading…
Reference in New Issue
Block a user