mass_driver.drivers.shell

Generic shell command driver

Module Contents

Classes

ShellDriver

Run a generic shell command

API

class mass_driver.drivers.shell.ShellDriver[source]

Bases: mass_driver.models.patchdriver.PatchDriver

Run a generic shell command

For instance, the following is a valid “sed” invocation:

ShellDriver(command=["sed", "-i", "s/v0.1.0/v0.2.0/g", "version.txt"])

Note that the process is run inside subprocess.check_call() (raises CalledProcessError on bad exit code).

command: list[str] = None

Shell command to apply to the repository, as string list

shell: bool = True

Passed to subprocess.run, to enable true shell behaviour rather than exec

run(repo: mass_driver.models.repository.ClonedRepo) mass_driver.models.patchdriver.PatchResult[source]

Run the command on the repo