Skip to content

Commit

Permalink
v1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian committed Jan 20, 2021
1 parent 2eeb36e commit f5a75ae
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 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]>"]
version = "1.11.0"
version = "1.12.0"

[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
Expand Down
3 changes: 2 additions & 1 deletion src/AppServer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,11 @@ function startup(port::Int, host::String = Genie.config.server_host;
status = if async
@async command()
else
print_server_status("Web Server starting at $server_url - press Ctrl/Cmd+C to stop the server.")
command()
end

if status.state == :runnable
if status !== nothing && status.state == :runnable
SERVERS.webserver = status

print_server_status("Web Server running at $server_url")
Expand Down
30 changes: 21 additions & 9 deletions src/Generator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,31 @@ function write_resource_file(resource_path::String, file_name::String, resource_
end


function binfolderpath(path::String) :: String
bin_folder_path = joinpath(path, Genie.config.path_bin)
isdir(bin_folder_path) || mkpath(bin_folder_path)

bin_folder_path
end


"""
setup_windows_bin_files(path::String = ".") :: Nothing
Creates the bin/server and bin/repl binaries for Windows
"""
function setup_windows_bin_files(path::String = ".") :: Nothing
open(joinpath(path, Genie.config.path_bin, "repl.bat"), "w") do f
bin_folder_path = binfolderpath(path)

open(joinpath(bin_folder_path, "repl.bat"), "w") do f
write(f, "\"$JULIA_PATH\" --color=yes --depwarn=no --project=@. -q -i -- \"%~dp0..\\$(Genie.BOOTSTRAP_FILE_NAME)\" %*")
end

open(joinpath(path, Genie.config.path_bin, "server.bat"), "w") do f
open(joinpath(bin_folder_path, "server.bat"), "w") do f
write(f, "\"$JULIA_PATH\" --color=yes --depwarn=no --project=@. -q -i -- \"%~dp0..\\$(Genie.BOOTSTRAP_FILE_NAME)\" s %*")
end

open(joinpath(path, Genie.config.path_bin, "runtask.bat"), "w") do f
open(joinpath(bin_folder_path, "runtask.bat"), "w") do f
write(f, "\"$JULIA_PATH\" --color=yes --depwarn=no --project=@. -q -- \"%~dp0..\\$(Genie.BOOTSTRAP_FILE_NAME)\" -r %*")
end

Expand All @@ -147,21 +157,23 @@ end
Creates the bin/server and bin/repl binaries for *nix systems
"""
function setup_nix_bin_files(path::String = ".") :: Nothing
open(joinpath(path, Genie.config.path_bin, "repl"), "w") do f
bin_folder_path = binfolderpath(path)

open(joinpath(bin_folder_path, "repl"), "w") do f
write(f, "#!/bin/sh\n" * raw"julia --color=yes --depwarn=no --project=@. -q -L $(dirname $0)/../bootstrap.jl -- \"$@\"")
end

open(joinpath(path, Genie.config.path_bin, "server"), "w") do f
open(joinpath(bin_folder_path, "server"), "w") do f
write(f, "#!/bin/sh\n" * raw"julia --color=yes --depwarn=no --project=@. -q -i -- $(dirname $0)/../bootstrap.jl s \"$@\"")
end

open(joinpath(path, Genie.config.path_bin, "runtask"), "w") do f
open(joinpath(bin_folder_path, "runtask"), "w") do f
write(f, "#!/bin/sh\n" * raw"julia --color=yes --depwarn=no --project=@. -q -- $(dirname $0)/../bootstrap.jl -r \"$@\"")
end

chmod(joinpath(path, Genie.config.path_bin, "server"), 0o700)
chmod(joinpath(path, Genie.config.path_bin, "repl"), 0o700)
chmod(joinpath(path, Genie.config.path_bin, "runtask"), 0o700)
chmod(joinpath(bin_folder_path, "server"), 0o700)
chmod(joinpath(bin_folder_path, "repl"), 0o700)
chmod(joinpath(bin_folder_path, "runtask"), 0o700)

nothing
end
Expand Down

2 comments on commit f5a75ae

@essenciary
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/28360

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.12.0 -m "<description of version>" f5a75aecd1826a70ae37756c3bd06dc43e54aa35
git push origin v1.12.0

Please sign in to comment.