Skip to content

Commit

Permalink
Environment: try to format sys env values coming from nimp env
Browse files Browse the repository at this point in the history
  • Loading branch information
jasugun committed Dec 6, 2024
1 parent e6eb55a commit d1025b8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion nimp/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,14 @@ def run(self, argv):

if hasattr(self, 'environment'):
for key, val in self.environment.items():
os.environ[key] = val
try: # TODO: should we throw?
os.environ[key] = self.format(val)
except KeyError:
os.environ[key] = val
logging.warning(
"Could not interpolate %s. Adding un-interpolated %s=%s to environment",
val, key, val
)

if self.command is None:
logging.error("No command specified. Please try nimp -h to get a list of available commands")
Expand Down

0 comments on commit d1025b8

Please sign in to comment.