diff --git a/Project.toml b/Project.toml index 79ccbb8..595fbf5 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "PSRContinuousDeployment" uuid = "f0087d4c-ff99-426e-93c9-09c1a88911f9" -version = "0.6.0" +version = "0.7.0" [deps] AWS = "fbe9abb3-538b-5e4e-ba9e-bc94f4f92ebc" diff --git a/src/psrhub.jl b/src/psrhub.jl index d812b34..31fcd82 100644 --- a/src/psrhub.jl +++ b/src/psrhub.jl @@ -2,7 +2,8 @@ function bundle_psrhub( configuration::Configuration, aws_access_key::AbstractString, aws_secret_key::AbstractString, - psrhub_version::AbstractString, + psrhub_version::AbstractString; + examples_path::Union{Nothing, AbstractString} = nothing, ) bucket = "psr-update-modules" @@ -46,11 +47,29 @@ function bundle_psrhub( Log.info("PSRHUB: Removing the $psrhub_zip") rm(psrhub_zip_path, force = true) + Log.info("PSRHUB: Renaming psrhub.exe to $target.exe") + mv(joinpath(build_path, "psrhub.exe"), joinpath(build_path, "$target.exe"), force = true) + Log.info("PSRHUB: Creating $target.bat") open(joinpath(build_path, "$target.bat"), "w") do io - writeln(io, "psrhub.exe > psrhub.log 2>&1") + writeln(io, "$target.exe > psrhub.log 2>&1") return nothing end + if !isnothing(examples_path) + build_examples_path = joinpath(build_path, "examples") + + if isdir(build_examples_path) + Log.info("COMPILE: Removing examples directory") + rm(build_examples_path, force = true, recursive = true) + end + + Log.info("COMPILE: Creating examples directory") + mkdir(build_examples_path) + + Log.info("PSRHUB: Copying examples") + cp(examples_path, build_examples_path, force = true) + end + return nothing end