Skip to content

Commit

Permalink
documentation and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
citkane committed Aug 31, 2020
1 parent 80c3541 commit c0c07d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
15 changes: 3 additions & 12 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,17 @@ struct Configserror <:Exception
end

function deleteenvkey!(key::String)
try
if haskey(ENV, key)
delete!(ENV, key)
catch err
end
end

function parseenvkey(key::String, value)
try
return ENV[key]
catch err
return value
end
haskey(ENV, key) ? ENV[key] : value
end

function parsecustomenv!(tree::Dict, key::String, value)
try
tree[key] = ENV[value]
catch err
delete!(tree, key)
end
haskey(ENV, value) ? (tree[key] = ENV[value]) : delete!(tree, key)
end

function parsecustomenv!(tree::Dict)
Expand Down
2 changes: 1 addition & 1 deletion test/functional.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
init = @test_nowarn initconfig(; deployment_key=customkey, configs_directory=customdir)
@test init.configs_directory === customdir
@test init.deployment_key === customkey

@info "Initialise defaults"
init = @test_nowarn initconfig()
@test init.configs_directory === defaultpath
Expand Down

2 comments on commit c0c07d1

@citkane
Copy link
Owner Author

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 updated: JuliaRegistries/General/20446

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 v0.1.1 -m "<description of version>" c0c07d1e4ad3b26c1fb76396dd4f4f3255536b27
git push origin v0.1.1

Please sign in to comment.