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

Merge remote-tracking branch 'origin/dev' into dev

parents 206498fa 05ac60e3
No related branches found
No related tags found
1 merge request!4feat(spack_operation): implement setup_spack_env functionality
......@@ -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"),
logger: logging = logging.getLogger(__name__)):
"""Update or add an environment variable in ~/.bashrc."""
value = value.replace("$", r"\$")
with open(bashrc_path, "r") as file:
lines = file.readlines()
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