Skip to content
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

Interpolation of __FILE__ into cmd #28188

Closed
vchuravy opened this issue Jul 19, 2018 · 1 comment · Fixed by #37007
Closed

Interpolation of __FILE__ into cmd #28188

vchuravy opened this issue Jul 19, 2018 · 1 comment · Fixed by #37007
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@vchuravy
Copy link
Member

This used to work on 0.6

julia> @show @__FILE__
#= REPL[1]:1 =# @__FILE__() = "REPL[1]"
"REPL[1]"

julia> @show `$(@__FILE__)`
#= REPL[2]:1 =# @cmd("\$(@__FILE__)") = `none`
`none`
@JeffBezanson
Copy link
Member

#3150 would fix this. Workaround for now is to store the value of @__FILE__ in a variable:

f = @__FILE__
`$f`

Another way to fix this is to pass __source__ from the cmd macro into shell_parse, and have it set the current source file to that when it calls parse.

@StefanKarpinski StefanKarpinski added the bug Indicates an unexpected problem or unintended behavior label Jul 19, 2018
Keno pushed a commit that referenced this issue Aug 12, 2020
* fix 28188: filename lost in cmd interpolation

* move test to test/misc.jl
@KristofferC KristofferC mentioned this issue Aug 13, 2020
25 tasks
KristofferC pushed a commit that referenced this issue Aug 13, 2020
* fix 28188: filename lost in cmd interpolation

* move test to test/misc.jl

(cherry picked from commit 06b7f0b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants