Thanks to visit codestin.com
Credit goes to github.com

Skip to content

someoneonsmile/stow-cm

Repository files navigation

Config manager (gnu-stow like)

USAGE

config manager (gnu-stow like)

Usage: stow-cm <COMMAND>

Commands:
  install  Install packs
  remove   Remove packs
  reload   Reload packs (remove and install)
  clean    Scan and clean all symbol that link to pack from pack target
  encrypt  Scan files in the given pack for replacement variables, encrypt them, and replace them back to the original files
  decrypt  Scan files in the given pack for replacement variables, decrypt them, and replace them back to the original files
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version
stow-cm install ./nvim /path/to/pack
stow-cm remove ./nvim /path/to/pack
stow-cm reload ./nvim /path/to/pack
stow-cm clean ./nvim /path/to/pack
stow-cm encrypt ./nvim /path/to/pack
stow-cm decrypt ./nvim /path/to/pack

stow-cm install ./*

INSTALL

Arch

paru -S stow-cm
paru -S stow-cm-nightly-bin

CONFIG

Location

  • $XDG_CONFIG_HOME/stow-cm/config.toml: common config
  • {stow pack dir}/stow-cm.toml: pack config

note: it not uses the pack/pack_sub_path/stow-cm.toml

Format

# toml format

# The follow environment variable will be injected
# PACK_ID: hash of the package path.
# PACK_NAME: represents the last level of the package path.

# when targe is none both in pack_config and common_config, it will skip link the dir_tree
# env var support the default value: ${env:-default}
# target = '~'

# ! represents unset the value
# target = '!'

# default
target = '${XDG_CONFIG_HOME:-~/.config}/${PACK_NAME}/'

# override
override = [
    # single quotes not escaping
    '.*\.lua',
]

# ignore
ignore = [
    '.*\.md',
    ".*\\.lock",
]

# default, create a tree-folding symlink
fold = true

# default, use symlink, another mode is 'copy'
mode = 'symlink'

[init]
type = '[Bin/Python/Make/Lua/Shell/ShellStr]'
# Bin/Shell/Python/Make/Lua: file path relate on the pack
# ShellStr: string
content = 'pack_sub_path/to'

[clear]
type = '[Bin/Python/Make/Lua/Shell/ShellStr]'
# Bin/Shell/Python/Make: file path relate on the pack
# Script: string
# content = 'pack_sub_path/to'
content = '''
echo ${PACK_ID}
echo ${PACK_NAME}
if [ -d /path/to ]; then
  rm -rf /path/to
fi
'''

[encrypted]
# default
enable = false
# default
decrypted_path = '${XDG_DATA_HOME:-~/.local/share}/stow-cm/${PACK_ID}/decrypted/'
# default
left_boundry = '&{'
# default
right_boundry = '}'
# support ChaCha20-Poly1305 | AES-128-GCM | AES-256-GCM
# default ChaCha20-Poly1305
encrypted_alg = 'ChaCha20-Poly1305'
key_path = '/path/to/key'

TODO

  • ignore

  • override

  • init/clear script

  • valid conflict before install

  • protect mode (don't execute in non stow dir)

  • if target is none just skip stow dir

  • remove refact

  • github action (auto archive)

  • encrypted support

  • encrypted support skip binary file

  • attr macro Merge

  • more test and testable

  • doc update

  • refactor: clear cli command

  • pack unset global or default target value

  • log level from cli args

  • split override, bak file

  • unpack pack from args

  • move .stow-cm-track to $XDG_STATE_HOME

  • pack related properties combine into struct

  • support file copy mode

  • encrypted decrypted ignore binary file

  • sh auto complete

About

config manager (gnu-stow like)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages