Skip to content

Instantly share code, notes, and snippets.

@jcrossley3
Created July 27, 2010 18:15
Show Gist options
  • Save jcrossley3/492610 to your computer and use it in GitHub Desktop.
Save jcrossley3/492610 to your computer and use it in GitHub Desktop.
;; Setup PATH
(setenv "PATH" (shell-command-to-string "source ~/.bashrc; echo -n $PATH"))
;; Update exec-path with the contents of $PATH
(loop for path in (split-string (getenv "PATH") ":") do
(add-to-list 'exec-path path))
;; Grab other environment variables
(loop for var in (split-string (shell-command-to-string "source ~/.bashrc; env")) do
(let* ((pair (split-string var "="))
(key (car pair))
(value (cadr pair)))
(unless (getenv key)
(setenv key value))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment