diff --git a/Mopy/bash/barg.py b/Mopy/bash/barg.py index 358e939f1fa..242ed109d8d 100644 --- a/Mopy/bash/barg.py +++ b/Mopy/bash/barg.py @@ -45,7 +45,9 @@ def arg(group, dashed, descr, dest, action='store', dflt=None): 'Use this argument if Wrye Bash is located outside of the game ' 'directory, and automatic detection failed to find it.') arg(pathGroup, '-o', '--oblivionPath', dest='oblivionPath') - + # oblivionMods # + h = ('Specify the root directory for Wrye Bash managed files.') + arg(pathGroup, '-R', '--bash-root', dest='oblivionMods') ### User Path Group ### userPathGroup = parser.add_argument_group('User Directory Arguments', 'These arguments allow you to specify your user directories in ' @@ -144,6 +146,7 @@ def arg(group, dashed, descr, dest, action='store', dflt=None): '-q': '--quiet-quit', '-r': '--restore', '-u': '--userPath', + '-R': '--bash-root', } def convert_to_long_options(sys_argv): diff --git a/Mopy/bash/bash.py b/Mopy/bash/bash.py index ede4d36844c..1fd5cb29bc4 100644 --- a/Mopy/bash/bash.py +++ b/Mopy/bash/bash.py @@ -596,7 +596,7 @@ def _detect_game(opts, backup_bash_ini): #--They depend on setting the bash.ini and the game from . import initialization game_ini_path, init_warnings = initialization.init_dirs( - opts.personalPath, opts.localAppDataPath, bush_game) + opts.personalPath, opts.localAppDataPath, bush_game, bash_root=opts.oblivionMods) if init_warnings: warning_msg = _('The following (non-critical) warnings were found ' 'during initialization:') diff --git a/Mopy/bash/initialization.py b/Mopy/bash/initialization.py index 0927764c661..c967e5f5718 100644 --- a/Mopy/bash/initialization.py +++ b/Mopy/bash/initialization.py @@ -104,7 +104,7 @@ def _get_ini_path(ini_key, dir_key, *args): src = 'Relative Path' return idata_path, src -def init_dirs(personal, localAppData, game_info): +def init_dirs(personal, localAppData, game_info, bash_root=''): """Initialize bass.dirs dictionary. We need the bash.ini and the game being set, so this is called upon setting the game. Global structures that need info on Bash / Game dirs should be initialized here and set @@ -218,7 +218,8 @@ def init_dirs(personal, localAppData, game_info): dirs[u'tag_files'] = dirs[u'mods'].join(u'BashTags') dirs[u'ini_tweaks'] = dirs[u'mods'].join(u'INI Tweaks') #--Mod Data, Installers - oblivionMods, oblivionModsSrc = getOblivionModsPath(game_info) + oblivionMods = _get_cli_ini_path(bash_root, '-R', 'oblivionMods', game_info, getOblivionModsPath, "failed setting root","Specified bash root directory does not exist") + # oblivionMods, oblivionModsSrc = getOblivionModsPath(game_info) dirs[u'bash_root'] = oblivionMods deprint(f'Game Mods location set to {oblivionMods}') dirs['modsBash'], modsBashSrc = _get_ini_path('BashModData', 'bash_root',