Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sho/robust monorepo discovery #21

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions nimp/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,9 @@ def validate_uproject(self, urpoject):
def display_unreal_info(self):
''' display engine and selected uproject info '''
if hasattr(self, 'unreal_full_version') and hasattr(self, 'unreal_dir'):
logging.info(f'Found Unreal engine {self.unreal_full_version} in {self.unreal_dir}')
logging.info(f'Found Unreal Engine {self.unreal_full_version} in {self.unreal_dir}')
else:
logging.info('No Unreal engine loaded')
logging.info('No Unreal Engine found')
if hasattr(self, 'uproject') and hasattr(self, 'uproject_dir'):
logging.info(f'Found Unreal project {self.uproject} in {self.uproject_dir}')
else:
Expand Down
16 changes: 10 additions & 6 deletions nimp/unreal.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,17 @@ def load_config(env):
unreal_base_paths = [
'UnrealEngine',
'UE4',
'',
'.',
]
for unreal_path in unreal_base_paths:
unreal_dir = nimp.system.find_dir_containing_file(os.path.join(unreal_path, unreal_file))
if unreal_dir:
unreal_dir = os.path.join(unreal_dir, unreal_path)
break
for base in unreal_base_paths:
path_to_base = nimp.system.find_dir_containing_file(os.path.join(base, unreal_file))
if not path_to_base:
continue
# Sanity check: if `base` indicates a monorepo setup, check that it is really one
if base != '.' and not os.path.isfile(os.path.join(path_to_base, '.nimp/monorepo_commands/__init__.py')):
continue
unreal_dir = os.path.join(path_to_base, base)
break

if not unreal_dir:
env.is_unreal = env.is_ue4 = env.is_ue5 = False
Expand Down