This question is a follow up to How does one pre-load a clojure file in the leiningen repl?.
My ~/.lein/profiles.clj
looks as follows:
{
:user {:source-paths ["C:/Users/username/.lein/src"] }
}
My ~/.lein/src/user.clj
might look as follows:
(ns user)
(println "user file loaded")
When I run lein repl
within a folder containing a project.clj
, then the user.clj
file is executed, but when I run lein repl
from another folder it doesn't load my user profile. Is there a workaround for this or is this behavior by design? In fact, I know that Leinigen is indeed loading my profile.clj
(even when there is no project.clj) because there are also other things inside (taken from the excellent pimp my repl article). Leinigen is just having problems with my additional source-paths setting.
One other question related to this is the fact that I need to specify the full path of the folder for my user.clj
file : "C:/Users/username/.lein/src"
. When I change that to "~/.lein/src"
leiningen fails to load my file.
~
in a source-path should work? In general tilde expansion only works in Linux shells - I wouldn't expect it to work from within Java, or on a Windows platform. – Alex