Only append once

[GitHub #76]
This commit is contained in:
Aoran Zeng
2024-11-22 01:42:01 +08:00
parent 505b14895e
commit c1c495cf6d
10 changed files with 48 additions and 57 deletions

View File

@@ -32,15 +32,15 @@ pl_nodejs_nvm_setsrc (char *option)
{
chsrc_yield_source_and_confirm (pl_nodejs_binary_release);
char *env = xy_2strjoin ("export NVM_NODEJS_ORG_MIRROR=", source.url);
char *w = xy_2strjoin ("export NVM_NODEJS_ORG_MIRROR=", source.url);
char *zshrc = "~/.zshrc";
char *bashrc = "~/.bashrc";
chsrc_append_to_file (env, bashrc);
chsrc_append_to_file (w, bashrc);
if (xy_file_exist (zshrc))
chsrc_append_to_file (env, zshrc);
chsrc_append_to_file (w, zshrc);
chsrc_conclude (&source, SetsrcType_Auto);
}