-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: remove direct calls to require #17277
Conversation
When? It's supposed to be true for a REPL session and false for scripts. |
Inside ~$ cat .juliarc.jl
if isinteractive()
println("Interactive")
else
println("Not interactive")
end ~$ ~/Documents/src/julia/julia
Not interactive |
Ah. Wonder if/when that changed? |
Looks like a regression. I should put it back in the docs. |
It's intentional afaict. |
So I guess there's nothing to change for this PR. |
If you only want to use it in repo, you should call it in |
@@ -75,7 +75,7 @@ issuing the command:: | |||
|
|||
If you further add the following to your ``.juliarc.jl`` file :: | |||
|
|||
isinteractive() && isfile("_init.jl") && require("_init.jl") | |||
isfile("_init.jl") && include(joinpath(pwd(), "_init.jl")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd just do include("_init.jl")
, why is the joinpath
needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include is relative to current file. so at least this makes it consistent with the isfile
check. I'm not sure which one (relative to current file or PWD) is the goal here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example on the docs puts the case when _init.jl
is in the current dir:
...then calling julia from that directory...
I figured isfile
checks current dir, but include
will check the dir where .juliarc.jl
is located.
Regarding the changes on workflow-tips:
isinteractive()
evaluates to falseinclude("file.jl")
on.juliarc.jl
looks for files at the user's home folder, so I added a call topwd()
.