Skip to content

Commit

Permalink
Patch secret precompilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Salceanu committed Apr 12, 2024
1 parent 8db5118 commit 1f1da6d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Genie"
uuid = "c43c736e-a2d1-11e8-161f-af95117fbd1e"
authors = ["Adrian Salceanu <[email protected]> and the amazing Genie contributors ♥️"]
version = "5.29.0"
version = "5.30.0"

[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
Expand Down
6 changes: 5 additions & 1 deletion src/Generator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,11 @@ function write_secrets_file(app_path::String = ".") :: Nothing
ispath(secrets_path) || mkpath(secrets_path)

open(joinpath(secrets_path, Genie.Secrets.SECRETS_FILE_NAME), "w") do f
write(f, """Genie.Secrets.secret_token!("$(Genie.Secrets.secret())") """)
write(f, """try
Genie.Secrets.secret_token!("$(Genie.Secrets.secret())")
catch
end
""")
end

nothing
Expand Down
9 changes: 9 additions & 0 deletions src/Util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ function filterwhitespace(s::S, allowed::Vector{Char} = Char[])::String where {S
filter(x -> (x in allowed) || ! isspace(x), string(s))
end


"""
isprecompiling() :: Bool
Returns `true` if the current process is precompiling.
"""
isprecompiling() = ccall(:jl_generating_output, Cint, ()) == 1


const fws = filterwhitespace

end

0 comments on commit 1f1da6d

Please sign in to comment.