#directory #collect #env #restore #clearly

已删除 hoarder

一个简单的配置文件管理器,让事情更清晰。

0.1.0 2022年10月28日

#30 in #restore

MIT 协议

9KB
218 代码行

Hoarder

一个简单的配置文件管理器,让事情更清晰。

安装

cargo install hoarder

用法

示例: plimeor/dotfiles

设置

  1. 运行 hoarder init 以在当前目录创建一个 hoarder.json
  2. 将环境变量 HOARDER 设置为该目录
  3. 更新 hoarder.json 以指定要收集的文件,例如
{
  "nvim": {
    ".config/nvim": "~/.config/nvim"
  },
  "zsh": {
    ".zshrc": "~/.zshrc",
    ".zsh_profile": "~/.zsh_profile"
  }
}

收集

使用 hoarder collect 收集指定的文件并在原地留下符号链接,例如

- dotfiles # you should use env `HOARDER` to specify this dir
  - nvim
    - .config
      - nvim  
  - zsh
    - .zshrc
    - .zsh_profile 
  - hoarder.json # configuration 

还原

使用 hoarder restore 将文件复制回原始位置。

依赖关系

~0.7–1.6MB
~35K SLoC