(ctx, check, compiled_only, all_matches, force, verbose)
Remove build and test artifacts for the given CHECK.
    If CHECK is not specified, the current working directory is used.
Remove build and test artifacts for the given CHECK.
    If CHECK is not specified, the current working directory is used.
Remove build and test artifacts for the given CHECK . If CHECK is not specified the current working directory is used .
def clean(ctx, check, compiled_only, all_matches, force, verbose):
    """Remove build and test artifacts for the given CHECK.
    If CHECK is not specified, the current working directory is used.
    """
    if check:
        path = resolve_path(os.path.join(get_root(), check))
        if not dir_exists(path):
            abort(
                'Directory `{}` does not exist. Be sure to `ddev config set {repo} '
                'path/to/integrations-{repo}`.'.format(path, repo=ctx.obj['repo_choice'])
            )
    else:
        path = os.getcwd()

    if compiled_only:
        echo_waiting(f'Cleaning compiled artifacts in `{path}`...')
        removed_paths = remove_compiled_scripts(path, detect_project=not all_matches)
    else:
        force_clean_root = False
        target_description = 'artifacts'

        if force:
            force_clean_root = True
            target_description = 'all artifacts'
        elif basepath(path) in ('integrations-core', 'integrations-extras'):
            echo_warning(
                'You are running this from the root of the integrations project.\n'
                'By default, the following artifacts in the root directory will *not* be cleaned:'
            )
            echo_info(', '.join(DELETE_IN_ROOT))
            force_clean_root = click.confirm(
                'Should we clean the above artifacts too? (Use --force of -f to bypass this prompt)'
            )

            if force_clean_root:
                target_description = 'all artifacts'
            else:
                target_description = 'artifacts (excluding those listed above)'

        echo_waiting(f'Cleaning {target_description} in `{path}`...')
        removed_paths = clean_package(path, detect_project=not all_matches, force_clean_root=force_clean_root)

    if verbose:
        if removed_paths:
            echo_success('Removed paths:')
            for p in removed_paths:
                echo_info(f'    {p}')

    if removed_paths:
        echo_success('Cleaned!')
    else:
        echo_success('Already clean!')
def clean ( ctx , check , compiled_only , all_matches , force , verbose ) : if check : path = resolve_path ( os . path . join ( get_root ( ) , check ) ) if not dir_exists ( path ) : abort ( 'Directory `{}` does not exist. Be sure to `ddev config set {repo} ' 'path/to/integrations-{repo}`.' . format ( path , repo = ctx . obj [ 'repo_choice' ] ) ) else : path = os . getcwd ( ) if compiled_only : echo_waiting ( f'Cleaning compiled artifacts in `{path}`...' ) removed_paths = remove_compiled_scripts ( path , detect_project = not all_matches ) else : force_clean_root = False target_description = 'artifacts' if force : force_clean_root = True target_description = 'all artifacts' elif basepath ( path ) in ( 'integrations-core' , 'integrations-extras' ) : echo_warning ( 'You are running this from the root of the integrations project.\n' 'By default, the following artifacts in the root directory will *not* be cleaned:' ) echo_info ( ', ' . join ( DELETE_IN_ROOT ) ) force_clean_root = click . confirm ( 'Should we clean the above artifacts too? (Use --force of -f to bypass this prompt)' ) if force_clean_root : target_description = 'all artifacts' else : target_description = 'artifacts (excluding those listed above)' echo_waiting ( f'Cleaning {target_description} in `{path}`...' ) removed_paths = clean_package ( path , detect_project = not all_matches , force_clean_root = force_clean_root ) if verbose : if removed_paths : echo_success ( 'Removed paths:' ) for p in removed_paths : echo_info ( f'    {p}' ) if removed_paths : echo_success ( 'Cleaned!' ) else : echo_success ( 'Already clean!' )