Commit 824d2c9b authored by Samuel GAIST's avatar Samuel GAIST

[utils][management][install] Made beat.example location configurable

This allows to use beat.example from outside of beat.web location.
parent 19cf1959
......@@ -999,12 +999,20 @@ class Command(BaseCommand):
super(Command, self).__init__()
example_root = os.environ.get("BEAT_EXAMPLE_ROOT", None)
if example_root is None:
example_root = os.path.dirname(os.path.dirname(os.path.realpath(sys.argv[0])))
self.prefix = os.path.join(
os.path.dirname(os.path.dirname(os.path.realpath(sys.argv[0]))),
example_root,
'src',
'beat.examples',
'beat.examples',
)
if not os.path.exists(self.prefix):
raise RuntimeError("beat.examples path does not exists")
# gets a list of all available projects, excluding directories
ignore = ['system', 'LICENSE', '.git', '.gitignore', 'README.rst']
projects = os.listdir(self.prefix)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment