diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2023-02-09 10:06:59 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2023-02-09 10:07:46 -0700 |
commit | 13097e7f0e499f1b7b79ad747f66ae0938491b3d (patch) | |
tree | d9ab8c011e253b900924e7b7f8ac473e32648609 /lib-src/mr/config | |
parent | 9c7ee2f03570b63182a7a42d0723cd4f6b3ab477 (diff) | |
download | dotfiles-13097e7f0e499f1b7b79ad747f66ae0938491b3d.tar.gz |
drop 'mr stow' & skip performing other actions if repo is not stowed
Diffstat (limited to 'lib-src/mr/config')
-rw-r--r-- | lib-src/mr/config | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib-src/mr/config b/lib-src/mr/config index 6165a4ac..e6e7509f 100644 --- a/lib-src/mr/config +++ b/lib-src/mr/config @@ -45,10 +45,17 @@ autoci = : git_isclean = git is-clean git_clean = git clean -xdff -stow = hstow stow "$MR_REPO" -unstow = hstow unstow "$MR_REPO" -restow = hstow restow "$MR_REPO" -adopt = hstow adopt "$MR_REPO" +# There is no 'mr stow' to help avoid accidentally stowing repos that aren't +# intended ever to be stowed. Can type 'hstow stow .' for an initial stow. +lib = + when_stowed () { + if [ -e "$HOME/.STOW/$(echo "$MR_REPO" | tr / _)" ]; then + hstow "$MR_ACTION" "$MR_REPO" + fi + } +adopt = when_stowed +unstow = when_stowed +restow = when_stowed # Repack git-remote-gcrypt origin remotes. # Useful to avoid surprise repacks; see git-remote-gcrypt README.rst. |