Skip to content

Instantly share code, notes, and snippets.

@JayBazuzi
Last active July 15, 2024 15:16
Show Gist options
  • Save JayBazuzi/cbbce04e1dd5e768d537f3aaf5573938 to your computer and use it in GitHub Desktop.
Save JayBazuzi/cbbce04e1dd5e768d537f3aaf5573938 to your computer and use it in GitHub Desktop.
We have a tool we "distribute" via Git - clone and run it.

Quick Start

Mac/Linux

git clone http://..../foo
cd foo
./foo.sh

Windows

git clone http://..../foo
cd foo
.\foo.cmd --bar

Run with --help for more options.

def test_bootstrap_mac_and_linux():
instructions = textwrap.dedent("""\
git clone http://..../foo
cd foo
./foo.sh
""" + "--help))
with temporary_directory = TemporaryDirectory():
result = subprocess.run(
instructions,
shell=True,
check=True,
capture=True,
text=True,
cwd = temporary_directory
)
assert result... # was it able to print help?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment