Skip to content
Snippets Groups Projects
Commit 9a8557b7 authored by Jithu Murugan's avatar Jithu Murugan
Browse files

Merge branch 'dev' into VT-70-function-Migrate-Spack-env-setup-into-ESD-repo-with-buildcache

parents 54483bec 2b900989
1 merge request!4feat(spack_operation): implement setup_spack_env functionality
Pipeline #60130 passed with stages
in 21 minutes and 54 seconds
...@@ -97,6 +97,7 @@ def copy_to_tmp(file_path: Path) -> Path: ...@@ -97,6 +97,7 @@ def copy_to_tmp(file_path: Path) -> Path:
def set_bashrc_variable(var_name: str, value: str, bashrc_path: str = os.path.expanduser("~/.bashrc"), def set_bashrc_variable(var_name: str, value: str, bashrc_path: str = os.path.expanduser("~/.bashrc"),
logger: logging = logging.getLogger(__name__)): logger: logging = logging.getLogger(__name__)):
"""Update or add an environment variable in ~/.bashrc.""" """Update or add an environment variable in ~/.bashrc."""
value = value.replace("$", r"\$")
with open(bashrc_path, "r") as file: with open(bashrc_path, "r") as file:
lines = file.readlines() lines = file.readlines()
pattern = re.compile(rf'^\s*export\s+{var_name}=.*$') pattern = re.compile(rf'^\s*export\s+{var_name}=.*$')
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment