dolang-shell-modules 0.1.0

Stock embedded Do modules for the shell.
import 
  fs:
   - Path
  proc.run:
   - id
  xdg

pub def runtime_dir()
  (xdg.runtime_dir() || Path "/run/user/$(sub id "-u")")

pub def cache_home()
  xdg.cache_home()

pub def cache_root()
  let path = (cache_home() / "dolang-container")
  if !path.exists()
    path.create_dir all: true
  path

pub def cache_dir id
  let path = (cache_root() / "mounts" / id.replace "/" "_")
  if !path.exists()
    path.create_dir all: true
  path