Преглед изворни кода

[tools] support Env for fish shell

1ridic пре 1 година
родитељ
комит
ec9bbaceda
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      tools/menuconfig.py

+ 5 - 0
tools/menuconfig.py

@@ -219,6 +219,11 @@ def touch_env():
     if sys.platform != 'win32':
         env_sh = open(os.path.join(env_dir, 'env.sh'), 'w')
         env_sh.write('export PATH=~/.env/tools/scripts:$PATH')
+
+        # if fish config exists, generate env.fish
+        if os.path.exists(os.path.join(home_dir, '.config', 'fish', 'config.fish')):
+            env_fish = open(os.path.join(env_dir, 'env.fish'), 'w')
+            env_fish.write('set -gx PATH ~/.env/tools/scripts $PATH')
     else:
         if os.path.exists(os.path.join(env_dir, 'tools', 'scripts')):
             os.environ["PATH"] = os.path.join(env_dir, 'tools', 'scripts') + ';' + os.environ["PATH"]