Skip to content

Commit aa296c1

Browse files
author
Janis Erdmanis
committed
adding compat
1 parent f8ae534 commit aa296c1

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

AppEnv/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ uuid = "9f11263e-cf0d-4932-bae6-807953dbea74"
33
authors = ["Janis Erdmanis <[email protected]>"]
44
version = "0.1.0"
55

6+
[compat]
7+
julia = "1"
8+
69
[extras]
710
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
811

AppEnv/src/AppEnv.jl

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ function set_load_path!(LOAD_PATH; module_name="")
181181

182182
empty!(LOAD_PATH)
183183
push!(LOAD_PATH, "@", "@stdlib")
184-
#isempty(module_name) ? push!(LOAD_PATH, joinpath(Sys.STDLIB, "MainEnv")) : push!(LOAD_PATH, joinpath(Sys.STDLIB, module_name))
185184
push!(LOAD_PATH, joinpath(Sys.STDLIB, module_name))
186185

187186
end
@@ -242,7 +241,6 @@ function set_depot_path_macos!(DEPOT_PATH::Vector{String}; app_name)
242241
global USER_DATA = joinpath(homedir(), ".config", app_name)
243242
end
244243

245-
# Modify DEPOT_PATH (equivalent to JULIA_DEPOT_PATH)
246244
empty!(DEPOT_PATH)
247245
push!(DEPOT_PATH, user_depot, joinpath(dirname(Sys.BINDIR), "share/julia"))
248246

@@ -252,17 +250,15 @@ end
252250
function set_depot_path_snap!(DEPOT_PATH::Vector{String})
253251

254252
empty!(DEPOT_PATH)
255-
push!(DEPOT_PATH, dirname(dirname(Sys.STDLIB)))
256253

257254
if haskey(ENV, "SNAP")
258255
@info "Application running as SNAP"
259256

260257
global USER_DATA = ENV["SNAP_USER_DATA"]
261258

262-
# correct
263-
pushfirst!(DEPOT_PATH, ENV["SNAP_DATA"])
264-
pushfirst!(DEPOT_PATH, ENV["SNAP_USER_COMMON"])
265-
259+
push!(DEPOT_PATH, ENV["SNAP_USER_COMMON"])
260+
push!(DEPOT_PATH, ENV["SNAP_DATA"])
261+
266262
else
267263
@info "Application running in bare host environment."
268264

@@ -272,10 +268,12 @@ function set_depot_path_snap!(DEPOT_PATH::Vector{String})
272268
global USER_DATA = mktempdir()
273269
end
274270

275-
pushfirst!(DEPOT_PATH, joinpath(USER_DATA, "cache"))
271+
push!(DEPOT_PATH, joinpath(USER_DATA, "cache"))
276272

277273
end
278274

275+
push!(DEPOT_PATH, dirname(dirname(Sys.STDLIB)))
276+
279277
return
280278
end
281279

@@ -382,8 +380,8 @@ function init(;
382380
return
383381
end
384382

385-
function reset_cache()
386383

384+
function reset_cache()
387385

388386
pkg = Base.PkgId(Base.UUID("9f11263e-cf0d-4932-bae6-807953dbea74"), "AppEnv")
389387
cache_dir = Base.compilecache_path(pkg)
@@ -395,8 +393,5 @@ function reset_cache()
395393

396394
end
397395

398-
function __init__()
399-
#reset_cache()
400-
end
401396

402397
end # module AppEnv

0 commit comments

Comments
 (0)