Skip to content

Commit

Permalink
if appdata not available, use same fallback as in jupyter_core/paths.py
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengj authored Jan 24, 2019
1 parent 1cd102e commit 1d7dc50
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions deps/kspec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ copy_config(src, dest) = cp(src, joinpath(dest, basename(src)), force=true)
CSIDL_APPDATA = 0x001a
result = ccall((:SHGetFolderPathW,:shell32), stdcall, Cint,
(Ptr{Cvoid},Cint,Ptr{Cvoid},Cint,Ptr{UInt8}),C_NULL,CSIDL_APPDATA,C_NULL,0,path)
return result == 0 ? transcode(String, resize!(path, findfirst(iszero, path)-1)) : homedir()
return result == 0 ? transcode(String, resize!(path, findfirst(iszero, path)-1)) : get(ENV, "APPDATA", "")
end
function default_jupyter_data_dir()
APPDATA = appdata()
return !isempty(APPDATA) ? joinpath(APPDATA, "jupyter") : joinpath(get(ENV, "JUPYTER_CONFIG_DIR", joinpath(homedir(), ".jupyter")), "data")
end
default_jupyter_data_dir() = joinpath(appdata(), "jupyter")
elseif Sys.isapple()
default_jupyter_data_dir() = joinpath(homedir(), "Library/Jupyter")
else
Expand Down

0 comments on commit 1d7dc50

Please sign in to comment.