Do not inject environment variables in the user shell file.

Overview

Currently GDK is injecting some exports on my shellrc (zshrc in this case). For me this is a bit annoying for 2 reasons:

  1. The list of env var might grow polluting my dotfiles
  2. This breaks my current dotfiles management workflow/organization.

The current injected var are:

+
+# Added by GDK bootstrap
+export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig:${PKG_CONFIG_PATH}"
+
+# Added by GDK bootstrap
+export RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/local/opt/openssl@1.1 --with-readline-dir=/usr/local/opt/readline"

Proposal (optional)

Instead of injecting variables we could inject a source GDK_PATH/env.

Pros

  • Regardless the number of variables this is a one change the user shell
  • Single entry point to extend other shell features (completion, etc)
  • the GDK/env could export GDK_ENV_LOADED=1 to avoid re-injections

Cons

  • Have to change the current approach.

Environment (optional)

  • Operating System: macOS
  • Ruby version: ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin19]
  • GDK version: 61f2d9c4 (latest, updated daily)
Edited by Kassio Borges