From f4e24fc7f7e01d3ea0ac9a324eb67a65df9cb972 Mon Sep 17 00:00:00 2001 From: Adrian Salceanu Date: Thu, 8 Oct 2020 23:51:20 +0200 Subject: [PATCH] v1.5.1 - fixes in plugins install API --- Project.toml | 2 +- src/Plugins.jl | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Project.toml b/Project.toml index 5e6b23f82..543223e0e 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Genie" uuid = "c43c736e-a2d1-11e8-161f-af95117fbd1e" authors = ["Adrian Salceanu "] -version = "1.5.0" +version = "1.5.1" [deps] ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63" diff --git a/src/Plugins.jl b/src/Plugins.jl index bb55835a1..72ccc64d7 100644 --- a/src/Plugins.jl +++ b/src/Plugins.jl @@ -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 @@ -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