Skip to content

Commit

Permalink
Added docstring to clear.py
Browse files Browse the repository at this point in the history
  • Loading branch information
shivaniikum committed Apr 11, 2024
1 parent 092c1cc commit 1648661
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cupid/clear.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python
import os
import sys
import click
import cupid.util
import shutil
Expand All @@ -19,13 +18,18 @@ def readConfigFile(config_path):
return fullPath

else: #run_dir is empty/wasn't found in config file so return error
print("ERROR: 'run_dir' was empty/not found in the config file.")
sys.exit(1)
raise ValueError("'run_dir' was empty/not found in the config file.")

@click.command()
@click.argument('config_path')
#Entry point to this script
def clear(config_path):
"""Clears the contents of the 'computed_notebooks' folder at the location specified by the 'run_dir' variable in the 'config.yml' file.
Args: config_path - The path to the config.yml file.
"""

run_dir = readConfigFile(config_path)
#Delete the 'computed_notebooks' folder and all the contents inside of it
shutil.rmtree(run_dir)
Expand Down

0 comments on commit 1648661

Please sign in to comment.