Skip to main content

Module dotfile

Module dotfile 

Source
Expand description

Unified dot-file handling for vault storage

Dot-files (.gitignore, .envrc, etc.) need to be “neutralized” when stored in the vault to prevent them from having active effects (e.g., .gitignore affecting git’s view of the vault directory).

This module provides consistent transformation:

  • .gitignoredot.gitignore (neutralized)
  • dot.gitignore.gitignore (restored)

Functions§

is_dotfile
Check if a path component is a dot-file or dot-directory.
neutralize_name
Transform a dot-file name to neutralized form: .foodot.foo
neutralize_path
Transform an entire path, neutralizing each dot-component.
restore_name
Transform a neutralized name back to dot-file form: dot.foo.foo
restore_path
Transform an entire path, restoring each neutralized component.