-
-
Save plediii/34161 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun prepend-to-path (&rest paths) | |
(map 'nil (lambda (path) | |
(let ((old-paths (getenv "PATH"))) | |
(if (and old-paths (not (equal old-paths ""))) | |
(if (not (member path (split-string old-paths ":"))) | |
(setenv "PATH" (concat path ":" old-paths))) | |
(setenv "PATH" path))) | |
(if (not (member path exec-path)) | |
(setq exec-path (cons path exec-path)))) | |
(reverse (prune-directory-list paths))) | |
exec-path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment