Skip to content

Commit

Permalink
Merge pull request clawpack#76 from rjleveque/make_all_env
Browse files Browse the repository at this point in the history
allow environment passed in to make_all
  • Loading branch information
mandli committed Apr 17, 2014
2 parents 9dc9ade + ecf612d commit 3f46c69
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/python/clawutil/make_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,14 @@ def list_examples(examples_dir):
return dirlist


def make_all(examples_dir = '.',make_clean_first=False):
def make_all(examples_dir = '.',make_clean_first=False, env=None):
import os,sys

if env is None:
my_env = os.environ
else:
my_env = env

examples_dir = os.path.abspath(examples_dir)
if not os.path.isdir(examples_dir):
raise Exception("Directory not found: %s" % examples_dir)
Expand Down Expand Up @@ -103,7 +108,7 @@ def make_all(examples_dir = '.',make_clean_first=False):

# Run 'make all':
job = subprocess.Popen(['make','all'], \
stdout=fout,stderr=ferr)
stdout=fout,stderr=ferr,env=my_env)
return_code = job.wait()

if return_code == 0:
Expand Down

0 comments on commit 3f46c69

Please sign in to comment.