From 37b9e4b4530766de71987d08491cb0358caafbe0 Mon Sep 17 00:00:00 2001 From: TEC Date: Sun, 12 May 2024 21:52:18 +0800 Subject: [PATCH] Load no faces.toml when the DEPOT_PATH is empty In rare cases, it is possible that the DEPOT_PATH could be empty. As such, the assumption that first(DEPOT_PATH) will produce a valid value needs to be removed, in which case we simply won't automatically load a user faces.toml. --- src/StyledStrings.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/StyledStrings.jl b/src/StyledStrings.jl index bad34cc6..436c3540 100644 --- a/src/StyledStrings.jl +++ b/src/StyledStrings.jl @@ -18,8 +18,10 @@ include("legacy.jl") using .StyledMarkup function __init__() - userfaces = joinpath(first(DEPOT_PATH), "config", "faces.toml") - isfile(userfaces) && loaduserfaces!(userfaces) + if !isempty(DEPOT_PATH) + userfaces = joinpath(first(DEPOT_PATH), "config", "faces.toml") + isfile(userfaces) && loaduserfaces!(userfaces) + end Legacy.load_env_colors!() end