File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -51,10 +51,18 @@ const SEP = Deno.build.os == 'windows' ? ';' : ':'
5151
5252export function ConfigDefault ( env = Deno . env . toObject ( ) ) : Config {
5353 const home = flatmap ( env [ 'PKGX_HOME' ] , x => new Path ( x ) ) ?? Path . home ( )
54- const prefix = flatmap ( env [ 'PKGX_DIR' ] ?. trim ( ) , x => new Path ( x ) ) ?? home . join ( '.pkgx' )
54+ const prefix = flatmap ( env [ 'PKGX_DIR' ] ?. trim ( ) , x => new Path ( x ) ) ??
55+ flatmap ( env [ 'XDG_DATA_HOME' ] , x => new Path ( x ) . join ( "pkgx" ) ) ??
56+ home . join ( '.pkgx' )
5557 const pantries = env [ 'PKGX_PANTRY_PATH' ] ?. split ( SEP ) . compact ( x => flatmap ( x . trim ( ) , x => Path . abs ( x ) ?? Path . cwd ( ) . join ( x ) ) ) ?? [ ]
56- const cache = ( flatmap ( env [ "XDG_CACHE_HOME" ] , Path . abs ) ?? platform_cache_default ( home , env ) ) . join ( "pkgx" )
57- const data = ( flatmap ( env [ "XDG_DATA_HOME" ] , Path . abs ) ?? platform_data_home_default ( home , env ) ) . join ( "pkgx" )
58+ const cache = (
59+ ( Deno . build . os == 'linux' ? flatmap ( env [ "XDG_CACHE_HOME" ] , Path . abs ) : undefined )
60+ ?? platform_cache_default ( home , env )
61+ ) . join ( "pkgx" )
62+ const data = (
63+ ( Deno . build . os == 'linux' ? flatmap ( env [ "XDG_DATA_HOME" ] , Path . abs ) : undefined )
64+ ?? platform_data_home_default ( home , env )
65+ ) . join ( "pkgx" )
5866 const dist = env [ 'PKGX_DIST_URL' ] ?. trim ( ) ?? 'https://dist.pkgx.dev'
5967 const isCI = boolize ( env [ 'CI' ] ) ?? false
6068 const UserAgent = flatmap ( getv ( ) , v => `libpkgx/${ v } ` ) ?? 'libpkgx'
You can’t perform that action at this time.
0 commit comments