I tend to call this file ".juliarc.jl" as well, with my "~/.juliarc.jl" 
having the excerpt:

## give a local .juliarc.jl a chance
if chomp(readall(`pwd`)) != ENV["HOME"] 
    if isfile(".juliarc.jl") 
        require(".juliarc.jl") 
    end 
end


The `require` (rather than `include`) and the test for starting up in the 
home directory prevent infinite loops.

---david

On Sunday, February 8, 2015 at 10:03:39 AM UTC+1, Christian Peel wrote:
>
> See this discussion: 
> https://groups.google.com/forum/#!topic/julia-users/NCRtt3LNCMU
>
> The gist is that if one wants to have Julia run startDir/start.jl, then 
> add the following code to one's ~/.juliarc.jl
> if isfile("start.jl")
>   include("start.jl")
> end
>
>
> On Saturday, February 7, 2015 at 11:51:58 PM UTC-8, Kirill Ignatiev wrote:
>>
>> If I understand correctly, julia reads ~/.juliarc.jl, but I would like 
>> it, on start-up, to find the innermost containing directory that contains a 
>> juliarc file, and read that. That way, I can have project-specific settings 
>> for my repl.
>>
>> Is there a julia-standard way to do that? It doesn't seem to pick up 
>> juliarc.jl in the starting directory. I end up implementing this behaviour 
>> explicitly in my ~/.juliarc.jl, so I was wondering if there is something 
>> I'm missing.
>>
>>

Reply via email to