mirror of
https://github.com/status-im/infra-utils.git
synced 2025-02-23 09:28:08 +00:00
customize repos path with ANSIBLE_REPOS_PATH env var
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
e2acd95f62
commit
d7eea4a0e0
@ -1,10 +1,12 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# I could use yaml module, but it fucks ups the order and formatting.
|
# I could use yaml module, but it fucks ups the order and formatting.
|
||||||
import re
|
import re
|
||||||
|
from os import getenv
|
||||||
from os.path import isdir, expanduser
|
from os.path import isdir, expanduser
|
||||||
from subprocess import check_output
|
from subprocess import check_output
|
||||||
|
|
||||||
path = 'ansible/requirements.yml'
|
path = 'ansible/requirements.yml'
|
||||||
|
repos_path = getenv('ANSIBLE_REPOS_PATH', '~/work')
|
||||||
|
|
||||||
with open(path, 'r') as f:
|
with open(path, 'r') as f:
|
||||||
contents = f.readlines()
|
contents = f.readlines()
|
||||||
@ -48,7 +50,7 @@ for line in lines:
|
|||||||
|
|
||||||
# Read commits from repos
|
# Read commits from repos
|
||||||
for entry in entries:
|
for entry in entries:
|
||||||
cwd = expanduser('~/work/%s' % entry['full_name'])
|
cwd = expanduser('%s/%s' % (repos_path, entry['full_name']))
|
||||||
if not isdir(cwd):
|
if not isdir(cwd):
|
||||||
print('No such repo: %s' % cwd)
|
print('No such repo: %s' % cwd)
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user