Skip to content

Commit

Permalink
Change to home directory before running.
Browse files Browse the repository at this point in the history
  • Loading branch information
wtgee committed Aug 26, 2023
1 parent e41c7a0 commit ed875c4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/panoptes/pocs/utils/cli/run.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

import typer
from panoptes.utils.time import current_time
from panoptes.utils.utils import altaz_to_radec
Expand All @@ -21,6 +23,8 @@ def run_auto(confirm: Annotated[bool, typer.Option(prompt='Are you sure you want
print()

if confirm is True:
# Change to home directory.
os.chdir(os.path.expanduser('~'))
try:
print('[green]Running POCS automatically!\t[bold]Press Ctrl-c to quit.[/bold][/green]')
pocs = POCS.from_config(simulators=simulator)
Expand Down Expand Up @@ -70,6 +74,8 @@ def get_altaz_observation(coords) -> Observation:

return alignment_observation

# Change to home directory.
os.chdir(os.path.expanduser('~'))
print('[green]Running POCS in alignment mode!\t[bold]Press Ctrl-c to quit.[/bold][/green]')
pocs = POCS.from_config(simulators=simulator)
pocs.initialize()
Expand Down

0 comments on commit ed875c4

Please sign in to comment.