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

'ue4 setroot' saves the root even when specified directory is NOT valid #68

Open
sleeptightAnsiC opened this issue Mar 24, 2024 · 0 comments

Comments

@sleeptightAnsiC
Copy link
Contributor

$ ue4 setroot jndksfjnaskldjfnksda
Set engine root path override: /home/kornel/Projects/ue4cli/jndksfjnaskldjfnksda
Using user-specified engine root: /home/kornel/Projects/ue4cli/jndksfjnaskldjfnksda
Warning: the specified directory does not appear to contain a valid version of the Unreal Engine.
# return code 0

$ ue4 root
Using user-specified engine root: /home/kornel/Projects/ue4cli/jndksfjnaskldjfnksda
/home/kornel/Projects/ue4cli/jndksfjnaskldjfnksda
# return code 0

This should not happen. Setting root override to a non-valid Engine directory should fail.
Currently it always saves the override no matter what, and only prints warning.

In #65 I already changed warning to error by throwing UnrealManagerException.
Now I need to also prevent the override from being saved.

This is a bit tricky to fix as currently we save the override first and then validate it afterwards:

def setEngineRootOverride(self, rootDir):
"""
Sets a user-specified directory as the root engine directory, overriding any auto-detection
"""
# Set the new root directory
rootDir = os.path.abspath(rootDir)
ConfigurationManager.setConfigKey('rootDirOverride', rootDir)
print('Set engine root path override: {}'.format(rootDir))
# Check that the specified directory is valid and warn the user if it is not
try:
self.getEngineVersion()
except:
print('Warning: the specified directory does not appear to contain a valid version of the Unreal Engine.')

@sleeptightAnsiC sleeptightAnsiC changed the title 'ue4 setroot' seets the root even when specified directory is NOT valid 'ue4 setroot' saves the root even when specified directory is NOT valid Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant