Skip to content

Commit

Permalink
xdg: remove memoize.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Oct 20, 2018
1 parent 5a420ca commit f3d1d78
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions basis/xdg/xdg.factor
@@ -1,29 +1,29 @@
! Copyright (C) 2015 John Benediktsson
! See http://factorcode.org/license.txt for BSD license

USING: environment memoize sequences splitting ;
USING: environment sequences splitting ;

IN: xdg

! http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

MEMO: xdg-data-home ( -- path )
: xdg-data-home ( -- path )
"XDG_DATA_HOME" os-env [ "~/.local/share" ] when-empty ;

MEMO: xdg-config-home ( -- path )
: xdg-config-home ( -- path )
"XDG_CONFIG_HOME" os-env [ "~/.config" ] when-empty ;

MEMO: xdg-cache-home ( -- path )
: xdg-cache-home ( -- path )
"XDG_CACHE_HOME" os-env [ "~/.cache" ] when-empty ;

MEMO: xdg-data-dirs ( -- paths )
: xdg-data-dirs ( -- paths )
"XDG_DATA_DIRS" os-env ":" split harvest
[ { "/usr/local/share" "/usr/share" } ] when-empty ;

MEMO: xdg-config-dirs ( -- paths )
: xdg-config-dirs ( -- paths )
"XDG_CONFIG_DIRS" os-env ":" split harvest
[ { "/etc/xdg" } ] when-empty ;

MEMO: xdg-runtime-dir ( -- path/f )
: xdg-runtime-dir ( -- path/f )
"XDG_RUNTIME_DIR" os-env ;
! TODO: check runtime secure permissions

0 comments on commit f3d1d78

Please sign in to comment.