Skip to content

Commit

Permalink
made sure bash can be anywere for subprocess in configure getting con…
Browse files Browse the repository at this point in the history
…figs
  • Loading branch information
TerryMcGuinness-NOAA committed May 31, 2024
1 parent 2e91edc commit bbeefc3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/wxflow/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import random
from typing import Optional
import subprocess
import shutil
from pathlib import Path
from pprint import pprint
from typing import Any, Dict, List, Union
Expand Down Expand Up @@ -111,8 +112,9 @@ def _get_shell_env(scripts: List) -> Dict[str, Any]:
runme = ''.join([f'source {s} ; ' for s in scripts])
magic = f'--- ENVIRONMENT BEGIN {random.randint(0,64**5)} ---'
runme += f'/bin/echo -n "{magic}" ; /usr/bin/env -0'
bash_path = shutil.which('bash')

Check warning on line 115 in src/wxflow/configuration.py

View check run for this annotation

Codecov / codecov/patch

src/wxflow/configuration.py#L115

Added line #L115 was not covered by tests
with open('/dev/null', 'w') as null:
env = subprocess.Popen(runme, shell=True, executable='/bin/bash', stdin=null.fileno(),
env = subprocess.Popen(runme, shell=True, executable=bash_path, stdin=null.fileno(),

Check warning on line 117 in src/wxflow/configuration.py

View check run for this annotation

Codecov / codecov/patch

src/wxflow/configuration.py#L117

Added line #L117 was not covered by tests
stdout=subprocess.PIPE)
(out, err) = env.communicate()
out = out.decode()
Expand Down

0 comments on commit bbeefc3

Please sign in to comment.