From 4f7eeb12d6b529f87184a1292198da9e2fd91367 Mon Sep 17 00:00:00 2001 From: Harald Wartig Date: Wed, 10 Apr 2019 15:56:20 +0200 Subject: [PATCH] Fix `fnm env` for fish shell. (#91) I added `-gx` to the `set` commands for fish so that the variables can be picked up by later runs of fnm. There are cases where the setup current code already works however it doesn't when the `FNM_...` variables haven't been exported globally before. --- executable/Env.re | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/executable/Env.re b/executable/Env.re index 127a165..5932aa0 100644 --- a/executable/Env.re +++ b/executable/Env.re @@ -104,12 +104,12 @@ let run = (~forceShell, ~multishell, ~nodeDistMirror, ~fnmDir, ~useOnCd) => { ) |> Console.log; | Fish => - Printf.sprintf("set PATH %s/bin $PATH;", path) |> Console.log; - Printf.sprintf("set %s %s;", Config.FNM_MULTISHELL_PATH.name, path) + Printf.sprintf("set -gx PATH %s/bin $PATH;", path) |> Console.log; + Printf.sprintf("set -gx %s %s;", Config.FNM_MULTISHELL_PATH.name, path) |> Console.log; - Printf.sprintf("set %s %s;", Config.FNM_DIR.name, fnmDir) |> Console.log; + Printf.sprintf("set -gx %s %s;", Config.FNM_DIR.name, fnmDir) |> Console.log; Printf.sprintf( - "set %s %s", + "set -gx %s %s", Config.FNM_NODE_DIST_MIRROR.name, nodeDistMirror, )