Skip to content

Commit

Permalink
Changes to artifact definitions search locations
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Jan 14, 2024
1 parent 55496c6 commit 6406e09
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions plaso/cli/helpers/artifact_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import os
import sys

import artifacts

from artifacts import errors as artifacts_errors
from artifacts import reader as artifacts_reader
from artifacts import registry as artifacts_registry
Expand Down Expand Up @@ -70,10 +72,14 @@ def ParseOptions(cls, options, configuration_object):

artifacts_path = getattr(options, 'artifact_definitions_path', None)

if (not artifacts_path or not os.path.exists(artifacts_path)) and (
configuration_object.data_location):
artifacts_path = os.path.dirname(configuration_object.data_location)
artifacts_path = os.path.join(artifacts_path, 'artifacts')
if not artifacts_path or not os.path.exists(artifacts_path):
artifacts_path = os.path.join(
os.path.dirname(artifacts.__file__), 'data')

if (not os.path.exists(artifacts_path) and
configuration_object.data_location):
artifacts_path = os.path.dirname(configuration_object.data_location)
artifacts_path = os.path.join(artifacts_path, 'artifacts')

if not os.path.exists(artifacts_path) and 'VIRTUAL_ENV' in os.environ:
artifacts_path = os.path.join(
Expand Down

0 comments on commit 6406e09

Please sign in to comment.