Skip to content

Commit

Permalink
feat(env): allow environment variables with underscore
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherpickering committed Mar 30, 2023
1 parent 52a18d8 commit ae0df73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ packages/assert.sh
packages/atlas-hub-[0-9]*.[0-9]*.[0-9]*
config_cust.py

.ruff_cache
package-lock.json
*.sqlite
static/css/
Expand Down
6 changes: 2 additions & 4 deletions runner/scripts/em_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,15 +270,13 @@ def __pip_install(self) -> None:
def __run_script(self) -> None:
try:
# create environment from params
env = (" && ").join(
env = ("").join(
[
f'export {re.sub(r"[^a-zA-Z]", "", key)}="{value}"'
f'{re.sub(r"[^a-zA-Z_]", "", key)}="{value}" '
for key, value in self.params.read().items()
]
)

env = env + " && " if env != "" else ""

# if data files exist, pass them as a param.
cmd = (
f'{env}"{self.env_path}/bin/python" "{self.job_path}/{self.script}" '
Expand Down

0 comments on commit ae0df73

Please sign in to comment.