Giter Site home page Giter Site logo

modulexcite / fsevents-tools Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ggreer/fsevents-tools

0.0 1.0 0.0 38 KB

Like inotify-tools but for OS X's FSEvents

License: Apache License 2.0

Makefile 5.34% Shell 22.46% M4 11.62% C 59.79% Perl 0.80%

fsevents-tools's Introduction

FSEvents Tools

Build Status

Floobits Status

Description

Command-line tools and scripts that use OS X's FSEvents API. Mostly useful for watching a directory and reacting to changes in it.

This post explains why I made this and includes more usage examples.

Usage examples

Alert if any files in a directory are changed.

notifywait /path/; echo "\007"

Rebuild LESS when anything in styles changes. Assuming you have a script similar to this rebuild_less.sh:

#!/bin/bash
for less_file in styles/*.less
do
  css_file=`echo $less_file | sed -E "s/.less//"`
  lessc $less_file $css_file.css
done

...just run:

notifyloop styles ./rebuild_less.sh

Automatically rsync files to a remote server if any of them are changed.

autorsync . 192.168.1.127:/var/www

The above invokes rsync with -avz (archive mode, verbose, compress). To pass additional arguments to rsync, for example:

RSYNC_OPTS='--exclude="*.pyc"' autorsync . 192.168.1.127:/var/www

To do the same thing "manually":

notifyloop . rsync -avz --exclude="*.pyc" . 192.168.1.127:/var/www

Building from source

Building master

In addition to the standard automake/autoconf/make, you'll need pkg-config. brew install pkg-config should do the trick.

Once you have all the dependencies, run ./autogen.sh and make install.

Building a release tarball

GPG-signed releases are available here.

Building release tarballs requires the same dependencies, except for automake and pkg-config. Once you've installed the dependencies, run:

./configure
make
make install

Depending on permissions, make install may require sudo.

Related software

  • inotify-tools. The original tools that inspired me to make fsevents-tools.
  • Lsyncd. A service to keep files synced between a master and one or more slave servers.

fsevents-tools's People

Contributors

anthonydisanti avatar easel avatar ggreer avatar klortho avatar yeahphil avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.