Skip to content

Commit

Permalink
Make shell expansion more obvious
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanv committed Mar 30, 2023
1 parent 1017da6 commit 913ef41
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
env:
TERM: xterm-256color
run: |
set -x
set -xe
cd example_pkg
spin build
spin test
Expand All @@ -57,7 +57,7 @@ jobs:
if: matrix.os == 'macos-latest'
shell: bash
run: |
set -x
set -xe
cd example_pkg
spin build
spin test
Expand All @@ -67,12 +67,13 @@ jobs:
spin run python -c 'import sys; del sys.path[0]; import example_pkg'
- name: Functional tests (Windows)
if: matrix.os == 'windows-latest'
shell: bash
run: |
Set-PSDebug -Trace 1
set -xe
cd example_pkg
spin build
spin test
spin sdist
spin example
spin run 'echo %PYTHONPATH%'
spin run 'echo $PYTHONPATH'
spin run python -c 'import sys; del sys.path[0]; import example_pkg'
5 changes: 4 additions & 1 deletion spin/cmds/meson.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,15 @@ def python(python_args):
@click.command(context_settings={"ignore_unknown_options": True})
@click.argument("args", nargs=-1)
def run(args):
"""🏁 Run a shell command with PYTHONPATH set.
"""🏁 Run a shell command with PYTHONPATH set
\b
spin run make
spin run 'echo $PYTHONPATH'
spin run python -c 'import sys; del sys.path[0]; import mypkg'
If you'd like to expand a shell variable, like `$PYTHONPATH` in the example
above, you need to provide a single, quoted command to `run`.
"""
if not len(args) > 0:
raise RuntimeError("No command given")
Expand Down

0 comments on commit 913ef41

Please sign in to comment.