Skip to content
A simple guard-shell clone that is able to execute a command when files are added or removed.
Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/guard
.gitignore
LICENSE
Readme.md
guard-addremove.gemspec

Readme.md

Guard::Addremove

This guard allows you execute shell commands whenever files are added or removed. It is very much like guard-shell, but ignores changes to existing files.

Install

Make sure you have guard installed.

Install the gem with:

gem install guard-addremove

Or add it to your Gemfile:

gem 'guard-addremove'

And then add a basic setup to your Guardfile:

guard init addremove

Usage

This guard was originally written to allow the removal of caches when the filesystem changes. This can be helpful in combination with vim's plugins CtrlP or Command-T. Find a quick guide how to use it in my blog.

guard :addremove do
  watch /.*/ do |m|
    `echo "#{m[0]} has been added or removed."`
  end
end

will simply print a message telling you a file has been added or removed.

You can’t perform that action at this time.