diff --git a/src/pymcnp/cli/_state.py b/src/pymcnp/cli/_state.py index 036c031..7e573f9 100644 --- a/src/pymcnp/cli/_state.py +++ b/src/pymcnp/cli/_state.py @@ -81,15 +81,7 @@ def __init__(self): self.path.parent.mkdir(exist_ok=True, parents=True) if not self.path.is_file(): - self.path.write_text( - "command = 'mcnp'\n" - '\n' - 'def prehook():\n' - ' return\n' - '\n' - 'def posthook():\n' - ' return\n' - ) + self._sync_down() def prehook(self): pass @@ -131,7 +123,7 @@ def _sync_down(self): posthook = 'def posthook():\n' + ''.join(inspect.getsourcelines(self.posthook)[0][1:]) self.path.write_text( - f'command = {self.command}\n' + '\n' + prehook + '\n' + posthook + '\n' + f"command = '{self.command}'\n" + '\n' + prehook + '\n' + posthook + '\n' )