Skip to content

Commit

Permalink
v1.5.1 - fixes in plugins install API
Browse files Browse the repository at this point in the history
  • Loading branch information
essenciary committed Oct 8, 2020
1 parent 6ab8ed2 commit f4e24fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 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.5.0"
version = "1.5.1"

[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
Expand Down
7 changes: 3 additions & 4 deletions src/Plugins.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,14 @@ Utility to allow users to install a plugin
"""
function install(path::String, dest::String; force = false)
isdir(dest) || mkpath(dest)

cd(dest)

isdir(Genie.config.path_plugins) || mkpath(Genie.config.path_plugins)

root_length = splitpath(path) |> length
depth = 0

for (root, dirs, files) in walkdir(path)
depth = length(splitpath(root)) - root_length
dest_path = joinpath(abspath(dest), splitpath(root)[end-depth:end]...)

try
Expand All @@ -150,8 +151,6 @@ function install(path::String, dest::String; force = false)
@error "Did not copy $(joinpath(root, f)) to $(joinpath(dest_path, f))"
end
end

depth += 1
end
end

Expand Down

0 comments on commit f4e24fc

Please sign in to comment.