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

RelocatableFolders does not handle removed files? #28

Closed
sairus7 opened this issue Oct 6, 2023 · 0 comments · Fixed by #29
Closed

RelocatableFolders does not handle removed files? #28

sairus7 opened this issue Oct 6, 2023 · 0 comments · Fixed by #29

Comments

@sairus7
Copy link

sairus7 commented Oct 6, 2023

We encountered it originally while trying to compile a server app with swagger spec, and it didn't work for some reason: GenieFramework/SwaggerMarkdown.jl#8

That is strange, because it worked in Oxygen https://github.com/ndortega/Oxygen.jl/pull/128/files

Looks like it works with entire folder but not with a single file:

import Pkg
Pkg.activate(; temp=true)
Pkg.add("RelocatableFolders")

open("test1.txt", "w") do io
    write(io, "some data")
end

mkdir("subfolder")
open("subfolder/test2.txt", "w") do io
    write(io, "another data")
end

module MyTest
    using RelocatableFolders 
    const FILE = @path joinpath(@__DIR__, "test1.txt")
    const FOLDER = @path joinpath(@__DIR__, "subfolder")
    read_from_file() = read(FILE, String)
    read_from_folder() = read(joinpath(FOLDER, "test2.txt"), String)
end

using .MyTest
MyTest.read_from_file() # ok
MyTest.read_from_folder() # ok

rm("subfolder"; recursive = true)
MyTest.read_from_folder() # ok

rm("test1.txt")
MyTest.read_from_file() # error
@MichaelHatherly MichaelHatherly linked a pull request Oct 7, 2023 that will close this issue
MichaelHatherly added a commit that referenced this issue Oct 7, 2023
Fix #28, handle "bare" files correctly in relocation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant