summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorK900 <me@0upti.me>2023-01-10 11:26:38 +0300
committerGitHub <noreply@github.com>2023-01-10 11:26:38 +0300
commit217178edb1127fb41ac4fd534d8a513c3dd3d81b (patch)
treea19169a1c5b38dd1daa6a5b1b070fe66191e71f4 /modules
parent79fa1eb78f746c30e41f1be76a209a407b25dc9d (diff)
parent86455818e51488863a0dbbb5d48952fd49202af2 (diff)
Merge pull request #197 from SuperSandro2000/PATH-robust
Don't add an extra :, make robust against grep aliases
Diffstat (limited to 'modules')
-rw-r--r--modules/wsl-distro.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/wsl-distro.nix b/modules/wsl-distro.nix
index 372925f..e75e7f0 100644
--- a/modules/wsl-distro.nix
+++ b/modules/wsl-distro.nix
@@ -174,9 +174,9 @@ with lib; {
# preserve $PATH from parent
variables.PATH = [ "$PATH" ];
extraInit = ''
- export WSLPATH=$(echo "$PATH" | tr ':' '\n' | grep -E "^${cfg.wslConf.automount.root}" | tr '\n' ':')
+ export WSLPATH=$(echo "$PATH" | tr ':' '\0' | command grep -a "^${cfg.wslConf.automount.root}" | tr '\0' ':')
${if cfg.interop.includePath then "" else ''
- export PATH=$(echo "$PATH" | tr ':' '\n' | grep -vE "^${cfg.wslConf.automount.root}" | tr '\n' ':')
+ export PATH=$(echo "$PATH" | tr ':' '\0' | command grep -av "^${cfg.wslConf.automount.root}" | tr '\0' ':')
''}
'';
};