Skip to content

nbeaver/stow-makefile

Repository files navigation

Makefile for using GNU stow more conveniently

Use with a new stow directory rooted at $HOME

  1. Make a new stow directory:

    mkdir ~/stow-packages
    
  2. Enter the stow directory:

    cd ~/stow-packages/
    
  3. Get Makefile into stow directory:

    wget 'https://raw.githubusercontent.com/nbeaver/stow-makefile/master/Makefile'
    
  4. Make a package directory, e.g. vim-config:

    mkdir vim-config
    
  5. Add a package file, e.g. an empty .vimrc:

    touch vim-config/.vimrc
    
  6. Run make to symlink vim-config/.vimrc to ~/.vimrc:

    make
    

If ~/.vimrc does not exist yet, the output will looks like this:

$ stow --target /home/username --verbose vim-config/
LINK: .vimrc => stow-packages/vim-config/.vimrc

You can check that stow was successful:

$ file ~/.vimrc
/home/username/.vimrc: symbolic link to stow-packages/vim-config/.vimrc

If ~/.vimrc already exists, the output will looks like this:

$ stow --target /home/username --verbose vim-config/
WARNING! stowing vim-config would cause conflicts:
  * existing target is neither a link nor a directory: .vimrc
All operations aborted.

In that case, if you want to keep the existing .vimrc, overwrite the empty .vimrc existing one and then stow it:

$ mv ~/.vimrc ./vim-config/.vimrc
$ make

Otherwise, remove the existing one and stow the empty one:

$ rm ~/.vimrc
$ make

Use with existing stow directory rooted at $HOME

  1. Copy or symlink Makefile to stow directory.
  2. make

Change location of stow directory

  1. cd to stow directory.
  2. make delete
  3. Move the stow directory to new location.
  4. cd to new location of stow directory.
  5. make

About

makefile to use with GNU Stow.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages