WillAbides / bindown

MIT License
14 stars 2 forks source link

Improve init #160

Open WillAbides opened 1 year ago

WillAbides commented 1 year ago

Improve bindown init to:

  1. Add cache and install_dir to .bindown.yaml if they are set to non-default.

  2. Add cache and install_dir directories to .gitignore.

Need to add an --install-dir param to init. It can use the global --cache option param for setting the cache dir. It also needs a --no-gitignore param to prevent it.

The .gitignore file should be in the same directory as .bindown.yaml even if it is in a subdirectory of the git repo.

The algorithm for .gitignore should be something like:

  1. If git isn't available in PATH, abort
  2. If .bindown.yaml isn't being created inside a git repo, abort
  3. For each directory of cache and install_dir
    1. Use git check-ignore to see if the directory is already ignored. If so continue to next directory.
    2. Append the directory to .gitignore in the same directory as .bindown.yaml