datadir

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDir

func DefaultDir() string

DefaultDir returns the platform-appropriate default data directory for grain.

  • Linux: ~/.grain/
  • macOS: ~/Library/Application Support/grain/
  • Windows: %APPDATA%\grain\

func EnsureExists

func EnsureExists(dir string) error

EnsureExists creates the data directory and standard subdirectories if they don't exist.

func Resolve

func Resolve(flagValue string) string

Resolve determines the data directory using this precedence:

  1. flagValue (--data-dir CLI flag) if non-empty
  2. GRAIN_DATA_DIR environment variable if set
  3. Platform default via DefaultDir()

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL