Skip to content

Commit

Permalink
✨ Add command to reset conductor.pros (#320)
Browse files Browse the repository at this point in the history
* Update version numbers

* 🐛 Fix default template selection #318

* Update version numbers

* Add command to reset conductor.pros

* Update pros/cli/conductor.py

Co-authored-by: BennyBot <48661356+BennyBot@users.noreply.github.com>

---------

Co-authored-by: ayushuk <ayushshukla30339@gmail.com>
Co-authored-by: Ayush Shukla <71904196+ayushuk@users.noreply.github.com>
Co-authored-by: BennyBot <48661356+BennyBot@users.noreply.github.com>
  • Loading branch information
4 people authored Feb 12, 2024
1 parent 5efc1e3 commit 18fb090
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions pros/cli/conductor.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,4 +371,27 @@ def query_depots(url: bool):
_conductor = c.Conductor()
ui.echo(f"Available Depots{' (Add --url for the url)' if not url else ''}:\n")
ui.echo('\n'.join(_conductor.query_depots(url))+"\n")


@conductor.command('reset')
@click.option('--force', is_flag=True, default=False, help='Force reset')
@default_options
def reset(force: bool):
"""
Reset conductor.pros
Visit https://pros.cs.purdue.edu/v5/cli/conductor.html to learn more
"""

if not force:
if not ui.confirm("This will remove all depots and templates. You will be unable to create a new PROS project if you do not have internet connection. Are you sure you want to continue?"):
ui.echo("Aborting")
return

# Delete conductor.pros
file = os.path.join(click.get_app_dir('PROS'), 'conductor.pros')
if os.path.exists(file):
os.remove(file)

ui.echo("Conductor was reset")

0 comments on commit 18fb090

Please sign in to comment.