anki-code/xontrib-sh

Support updating environment variables

Offen

#7 geöffnet am 23.03.2023

 (0 Kommentare) (1 Reaktion) (0 zugewiesene Personen)Python (3 Forks)github user discovery
good first issue

Repository-Metriken

Stars
 (65 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

The idea:

  1. Get prev_env = $(env) before running the sh-command
  2. Run sh-command. Example ! export QWE=123.
  3. Add saving env at the end of command: ! export QWE=123 ; env > /tmp/post_env.
  4. By comparing prev_env and post_env update the environment in the current session i.e. $QWE='123'

For community

⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment

Contributor Guide