Skip to content

publishing from Windows breaks with default arguments #391

Closed
@FirefoxMetzger

Description

@FirefoxMetzger

The problem

https://github.com/relekang/python-semantic-release/blob/f010a15dd03f4ef34e4093cc1a7ee357c6db12eb/semantic_release/dist.py#L31-L34

The above line works fine on Linux-based systems but breaks on Windows when using the default shell (PowerShell), because -rf is incorrect syntax. The default setting is to remove the dist folder after building, which currently breaks semantic-release publish unless deleting is explicitly disabled.

Expected behavior

Deletion of the folder works as expected regardless of operating system.

A fix that should work on any OS could look something like this

import shutil

def remove_dists(path: str):
    logger.debug(f"Removing build folder: `{path}`")
    shutil.rmtree(path)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working properly

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions