Skip to content

Commit

Permalink
Merge pull request #526 from dylanmtaylor/export-configuration
Browse files Browse the repository at this point in the history
Write user configuration JSON to a file in logs directory
  • Loading branch information
Torxed authored May 28, 2021
2 parents 59bb926 + 8d7045b commit 595bd65
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions examples/guided.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,10 @@ def perform_installation_steps():
print()
print('This is your chosen configuration:')
archinstall.log("-- Guided template chosen (with below config) --", level=logging.DEBUG)
archinstall.log(json.dumps(archinstall.arguments, indent=4, sort_keys=True, cls=archinstall.JSON), level=logging.INFO)
user_configuration = json.dumps(archinstall.arguments, indent=4, sort_keys=True, cls=archinstall.JSON)
archinstall.log(user_configuration, level=logging.INFO)
with open("/var/log/archinstall/user_configuration.json", "w") as config_file:
config_file.write(user_configuration)
print()

if not archinstall.arguments.get('silent'):
Expand Down Expand Up @@ -441,12 +444,18 @@ def perform_installation(mountpoint):
archinstall.arguments['harddrive'].keep_partitions = False
# Temporary workaround to make Desktop Environments work
if archinstall.arguments.get('profile', None) is not None:
archinstall.arguments['profile'] = archinstall.Profile(None, archinstall.arguments.get('profile', None))
if type(archinstall.arguments.get('profile', None)) is dict:
archinstall.arguments['profile'] = archinstall.Profile(None, archinstall.arguments.get('profile', None)['path'])
else:
archinstall.arguments['profile'] = archinstall.Profile(None, archinstall.arguments.get('profile', None))
else:
archinstall.arguments['profile'] = None
if archinstall.arguments.get('mirror-region', None) is not None:
selected_region = archinstall.arguments.get('mirror-region', None)
archinstall.arguments['mirror-region'] = {selected_region: archinstall.list_mirrors()[selected_region]}
if type(archinstall.arguments.get('mirror-region', None)) is dict:
archinstall.arguments['mirror-region'] = archinstall.arguments.get('mirror-region', None)
else:
selected_region = archinstall.arguments.get('mirror-region', None)
archinstall.arguments['mirror-region'] = {selected_region: archinstall.list_mirrors()[selected_region]}
archinstall.arguments['sys-language'] = archinstall.arguments.get('sys-language', 'en_US')
archinstall.arguments['sys-encoding'] = archinstall.arguments.get('sys-encoding', 'utf-8')
if archinstall.arguments.get('gfx_driver', None) is not None:
Expand Down

0 comments on commit 595bd65

Please sign in to comment.