Created
December 4, 2016 15:17
-
-
Save greister/4e67222565e4968437c179927e4543d2 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 re-seq (regexp string) | |
"Get a list of all regexp matches in a string" | |
(save-match-data | |
(let ((pos 0) | |
matches) | |
(while (string-match regexp string pos) | |
(push (match-string 0 string) matches) | |
(setq pos (match-end 0))) | |
matches))) | |
(setq reg "'\(.+\)'") | |
(setq lib-path-string (shell-command-to-string | |
"node -e 'console.log(module.paths)'")) | |
(insert (re-seq reg lib-path-string)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment