From 2b55e101832956cbd6b8119c6796ec2ca6b5f97f Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Thu, 8 Nov 2018 05:18:52 -0800 Subject: [PATCH] Allow multiple packages to be added/removed in a batch (#130) --- src/Conda.jl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Conda.jl b/src/Conda.jl index 1f6b53e..197e4fd 100644 --- a/src/Conda.jl +++ b/src/Conda.jl @@ -176,13 +176,15 @@ function _install_conda(env::Environment, force::Bool=false) end end -"Install a new package." -function add(pkg::AbstractString, env::Environment=ROOTENV) +const PkgOrPkgs = Union{AbstractString, AbstractVector{<: AbstractString}} + +"Install a new package or packages." +function add(pkg::PkgOrPkgs, env::Environment=ROOTENV) runconda(`install $(_quiet()) -y $pkg`, env) end -"Uninstall a package." -function rm(pkg::AbstractString, env::Environment=ROOTENV) +"Uninstall a package or packages." +function rm(pkg::PkgOrPkgs, env::Environment=ROOTENV) runconda(`remove $(_quiet()) -y $pkg`, env) end