-
Notifications
You must be signed in to change notification settings - Fork 3
/
jcb_client_path.py
executable file
·38 lines (22 loc) · 1.04 KB
/
jcb_client_path.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python
# --------------------------------------------------------------------------------------------------
import os
import sys
import yaml
# --------------------------------------------------------------------------------------------------
if __name__ == "__main__":
# Get the repo path from the argument
git_url_in = sys.argv[1]
# Get the path of this file
file_path = os.path.dirname(os.path.realpath(__file__))
# Open the jcb_apps.yaml file
with open(os.path.join(file_path, 'jcb_clients.yaml')) as file:
jcb_apps = yaml.load(file, Loader=yaml.FullLoader)
# Loop over jcb_apps and make sure required keys are present and add target_path
for app, app_conf in jcb_apps.items():
if git_url_in.lower() == app_conf['git_url'].lower():
print(os.path.join(file_path, 'src', 'jcb', 'configuration', 'apps', app))
exit(0)
# Fail if we got to here
exit(1)
# --------------------------------------------------------------------------------------------------