From 8ecad39bcae23867780ec211d06e6018888924c1 Mon Sep 17 00:00:00 2001 From: Josh Day Date: Fri, 13 Dec 2024 13:48:43 -0500 Subject: [PATCH] fix on windows --- src/DepotDelivery.jl | 10 ++++++++-- src/build_script.jl | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/DepotDelivery.jl b/src/DepotDelivery.jl index 7895b09..507e8e3 100644 --- a/src/DepotDelivery.jl +++ b/src/DepotDelivery.jl @@ -4,6 +4,12 @@ module DepotDelivery eval(Expr(:public, :build)) end +@static if Sys.iswindows() + delim = ';' +else + delim = ':' +end + #-----------------------------------------------------------------------------# build """ build(src = pwd(), dest=mktempdir(); triplet, platform, verbose, precompiled) @@ -23,7 +29,7 @@ Example: depot_path = build("/path/to/your/project") """ function build( - src::String = pwd(), # paths separated with ':' + src::String = pwd(), # paths separated with ':' (';' on Windows) dest::String = joinpath(mktempdir(), "depot"); triplet = nothing, platform = Base.BinaryPlatforms.HostPlatform(), @@ -38,7 +44,7 @@ function build( read(cmd, String) end -build(sources::Vector{String}, dest::String=joinpath(mktempdir(), "depot"); kw...) = build(join(sources, ':'), dest; kw...) +build(sources::Vector{String}, dest::String=joinpath(mktempdir(), "depot"); kw...) = build(join(sources, delim), dest; kw...) diff --git a/src/build_script.jl b/src/build_script.jl index 9c2ba12..913e09a 100644 --- a/src/build_script.jl +++ b/src/build_script.jl @@ -14,7 +14,8 @@ get_project_name(path) = (p = get_project(path); isnothing(p.name) ? splitpath(p #-----------------------------------------------------------------------------# ARGS verbose = verbose == "true" offline = offline == "true" -source_dict = Dict(x => get_project_name(x) for x in abspath.(split(sources, ':'))) +delim = Base.Sys.iswindows() ? ';' : ':' +source_dict = Dict(x => get_project_name(x) for x in abspath.(split(sources, delim))) platform = Base.parse(Base.BinaryPlatforms.Platform, triplet) for src in keys(source_dict)