Created
October 28, 2019 23:31
-
-
Save ampersanda/e3643a46c639aa7b2a2d4e87f0e6fa1f to your computer and use it in GitHub Desktop.
Expand home (~)
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
(defn expand-home [s] | |
(if (.startsWith s "~") | |
(clojure.string/replace-first s "~" (System/getProperty "user.home")) | |
s)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment