Skip to content
This repository has been archived by the owner on Jan 14, 2024. It is now read-only.

Commit

Permalink
Fix incorrectly propagating RKD_PATH to inner calls - RKD in RKD (exa…
Browse files Browse the repository at this point in the history
…mple: calling rkd in a bash script in YAML)
  • Loading branch information
blackandred committed May 9, 2020
1 parent a8e2a22 commit e96b215
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/rkd/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,22 @@ def create_unified_context(self, chdir: str = '') -> Context:
CURRENT_SCRIPT_PATH + '/internal',
'/usr/lib/rkd',
os.path.expanduser('~/.rkd'),
chdir + './.rkd'
os.getcwd() + '/.rkd'
]

if chdir:
paths += chdir + '/.rkd'

if os.getenv('RKD_PATH'):
paths += os.getenv('RKD_PATH', '').split(':')

# export for usage inside in makefiles
os.environ['RKD_PATH'] = ":".join(paths)

ctx = Context([], [])

for path in paths:
if os.path.isdir(path) and os.path.isfile(path + '/makefile.py'):
if os.path.isdir(path) and (os.path.isfile(path + '/makefile.py') or os.path.isfile(path + '/makefile.yaml')):
ctx = Context.merge(ctx, self._load_context_from_directory(path))

ctx.compile()
Expand Down

0 comments on commit e96b215

Please sign in to comment.