Skip to content
Permalink
a6b0d41fcc
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 58 lines (46 sloc) 1.2 KB
#!/usr/bin/env python3
from utils.settings import BASE_DIR, load_config
from pathlib import Path
import shutil
import os
def rm_dirs( config ):
path = Path( BASE_DIR, config['INPUT_DIR'] )
print( "removing dir '{}'".format( path ) )
shutil.rmtree(
path,
ignore_errors=True
)
# os.system('rm -rf "{}"'.format( path ))
path = Path( BASE_DIR, config['OUTPUT_DIR'] )
print( "removing dir '{}'".format( path ) )
shutil.rmtree(
path,
ignore_errors=True
)
# os.system('rm -rf "{}"'.format( path ))
def rm_docker_env_file( config ):
path = Path(
BASE_DIR / ".env"
)
print( "removing '{}'".format( path ) )
path.unlink()
if __name__ == '__main__':
from argparse import ArgumentParser
config = load_config()
parser = ArgumentParser(
description="clean up the repository"
)
parser.add_argument(
"--env-file",
action = "store_true"
)
parser.add_argument(
"--all",
action = "store_true"
)
args = parser.parse_args()
from stop import stop
stop( config )
rm_dirs( config )
if args.env_file or args.all:
rm_docker_env_file( config )