Skip to content

Commit

Permalink
Merge pull request #43 from psrenergy/rs/kwargs
Browse files Browse the repository at this point in the history
Change configuration parameters to kwargs
  • Loading branch information
raphasampaio authored Nov 13, 2024
2 parents 18ee473 + 48c0238 commit efc68ec
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "PSRContinuousDeployment"
uuid = "f0087d4c-ff99-426e-93c9-09c1a88911f9"
version = "0.8.2"
version = "0.9.0"

[deps]
AWS = "fbe9abb3-538b-5e4e-ba9e-bc94f4f92ebc"
Expand Down
54 changes: 27 additions & 27 deletions src/configuration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ struct Configuration
development_stage::DevelopmentStage.T
certificate_server_url::String

function Configuration(
function Configuration(;
target::AbstractString,
version::AbstractString,
package_path::AbstractString,
Expand Down Expand Up @@ -40,36 +40,36 @@ struct Configuration
"http://hannover.local.psrservices.net:5000",
)
end
end

function Configuration(
package_path::AbstractString;
development_stage::DevelopmentStage.T,
version_suffix::AbstractString = "",
)
compile_path = joinpath(package_path, "compile")
build_path = joinpath(compile_path, "build")
setup_path = joinpath(compile_path, "setup")

project_path = joinpath(package_path, "Project.toml")
project = TOML.parse(read(project_path, String))
target = project["name"]
function Configuration(
package_path::AbstractString;
development_stage::DevelopmentStage.T,
version_suffix::AbstractString = "",
)
compile_path = joinpath(package_path, "compile")
build_path = joinpath(compile_path, "build")
setup_path = joinpath(compile_path, "setup")

version = if isempty(version_suffix)
project["version"] * string(development_stage)
else
project["version"] * string(development_stage) * "." * version_suffix
end
project_path = joinpath(package_path, "Project.toml")
project = TOML.parse(read(project_path, String))
target = project["name"]

return Configuration(
target,
version,
package_path,
compile_path,
build_path,
setup_path,
development_stage,
)
version = if isempty(version_suffix)
project["version"] * string(development_stage)
else
project["version"] * string(development_stage) * "." * version_suffix
end

return Configuration(
target = target,
version = version,
package_path = package_path,
compile_path = compile_path,
build_path = build_path,
setup_path = setup_path,
development_stage = development_stage,
)
end

function is_stable_release(configuration::Configuration)
Expand Down

0 comments on commit efc68ec

Please sign in to comment.