Skip to content

Commit

Permalink
Raise minimum Julia to 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
tecosaur committed Jul 31, 2024
1 parent 6d26e10 commit a831846
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.5'
- '1.8'
- '1'
- 'nightly'
os:
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ authors = ["TEC <git@tecosaur.net>"]
version = "1.2.4"

[compat]
julia = "1.5"
julia = "1.8"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
22 changes: 0 additions & 22 deletions src/BaseDirs.jl
Original file line number Diff line number Diff line change
@@ -1,27 +1,5 @@
module BaseDirs

# Compat
@static if VERSION < v"1.8"
# `chopsuffix` is then also imported within `internals.jl`
function chopsuffix(s::Union{String, SubString{String}},
suffix::Union{String, SubString{String}})
if !isempty(suffix) && endswith(s, suffix)
astart = ncodeunits(s) - ncodeunits(suffix) + 1
@inbounds SubString(s, firstindex(s), prevind(s, astart))
else
SubString(s)
end
end
function chopprefix(s::Union{String, SubString{String}},
prefix::Union{String, SubString{String}})
if startswith(s, prefix)
SubString(s, 1 + ncodeunits(prefix))
else
SubString(s)
end
end
end

include("variables.jl")

function reload end
Expand Down
4 changes: 0 additions & 4 deletions src/internals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ using Base.Docs

export @defaccessor, @setxdg, @setxdgs

@static if VERSION < v"1.8"
import ..BaseDirs: chopsuffix
end

@static if Sys.isunix()
macro setxdg(envvar::Symbol, default)
quote $(esc(envvar))[] = if haskey(ENV, $("XDG_$envvar")) && !isempty(ENV[$("XDG_$envvar")])
Expand Down
6 changes: 1 addition & 5 deletions src/unix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ function reload()
@setxdg STATE_HOME "~/.local/state"
@setxdg BIN_HOME "~/.local/bin"
@setxdg CACHE_HOME "~/.cache"
@static if VERSION < v"1.6"
@setxdg RUNTIME_DIR joinpath("/run/user", rstrip(read(`id -u`, String)))
else
@setxdg RUNTIME_DIR joinpath("/run/user", string(Base.Libc.getuid()))
end
@setxdg RUNTIME_DIR joinpath("/run/user", string(Base.Libc.getuid()))
# User directories
userdirs = merge(parseuserdirs(first(CONFIG_DIRS[])),
parseuserdirs(CONFIG_HOME[]))
Expand Down

0 comments on commit a831846

Please sign in to comment.