Permalink
Cannot retrieve contributors at this time
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?
eoa2-xmldb/scripts/uninstall.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
43 lines (30 sloc)
887 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from utils.settings import BASE_DIR, load_config, create_docker_env_file | |
from pathlib import Path | |
import shutil | |
import os | |
def rm_dirs( config ): | |
path = Path( BASE_DIR, config['RUNTIME_DIR'] ) | |
print( "removing dir '{}'".format( path ) ) | |
shutil.rmtree( | |
path, | |
ignore_errors=True | |
) | |
def rm_docker_env_file( config ): | |
path = Path( | |
BASE_DIR / ".env" | |
) | |
print( "removing '{}'".format( path ) ) | |
path.unlink() | |
if __name__ == '__main__': | |
from argparse import ArgumentParser | |
create_docker_env_file( overwrite = False ) | |
config = load_config() | |
parser = ArgumentParser( | |
description="clean up the repository: remove xml database, remove sql database" | |
) | |
args = parser.parse_args() | |
from stop import stop | |
stop( config ) | |
rm_dirs( config ) | |
rm_docker_env_file( config ) |