Skip to content

Commit

Permalink
Merge pull request #1711 from avanwinkle/production-bundle-mc-machine…
Browse files Browse the repository at this point in the history
…-path

Support machine_path arg in MC production builds
  • Loading branch information
avanwinkle authored Sep 13, 2023
2 parents e5b1a3a + c6902d7 commit f1fdc97
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mpf/commands/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,16 @@ def __init__(self, args, path):
def production_bundle(self):
"""Create a production bundle."""
config_loader = YamlMultifileConfigLoader(self.machine_path, self.args.configfile, False, False)
mpf_config = config_loader.load_mpf_config()
if self.args.mc:
mc_config = config_loader.load_mc_config()

mpf_config = config_loader.load_mpf_config()
if self.args.dest_path:
mpf_config.set_machine_path(self.args.dest_path)

if self.args.mc:
mc_config = config_loader.load_mc_config()
if self.args.dest_path:
mc_config.set_machine_path(self.args.dest_path)

pickle.dump(mpf_config, open(ProductionConfigLoader.get_mpf_bundle_path(self.machine_path), "wb"))
if self.args.mc:
pickle.dump(mc_config, open(ProductionConfigLoader.get_mpf_mc_bundle_path(self.machine_path), "wb"))
Expand Down
4 changes: 4 additions & 0 deletions mpf/core/config_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ def get_machine_path(self):
"""Return machine path."""
return self._machine_path

def set_machine_path(self, value):
"""Set a new machine path."""
self._machine_path = value

def get_config_spec(self):
"""Return config spec."""
return self._config_spec
Expand Down

0 comments on commit f1fdc97

Please sign in to comment.