Created
June 10, 2015 19:35
-
-
Save ionrock/99e1b9dba0a772a2aa35 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 source-to-elisp (fname) | |
(with-temp-buffer | |
(insert-file fname) | |
(while (re-search-forward "^export \\(.*\\)=\\(.*\\)") | |
(let ((key (match-string 1)) | |
(value (replace-regexp-in-string "\'\"" "" (match-string 2)))) | |
(if (and key value) | |
(progn | |
(setenv key value))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment