Sha256: ca417fecf3a10f660417b60429b4136c92e7171a04483f2ee0b56451de0243b1

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

#!/usr/bin/env ruby
=begin =======================================================================

# TORK-HERALD 1 2016-02-13 20.0.1

## NAME

tork-herald - reports modified files

## SYNOPSIS

`tork-herald` [*OPTION*]...

## DESCRIPTION

This program monitors the current working directory and all those below it
recursively.  When any files therein are modified, it prints their relative
paths in a single-line JSON array to stdout.

## OPTIONS

`-h` [*PATTERN*], `--help` [*PATTERN*]
  Show this help manual and search for *PATTERN* regular expression therein.

## SEE ALSO

tork(1), tork-driver(1)

=end =========================================================================

$0 = File.basename(__FILE__) # for easier identification in ps(1) output

require 'binman'
BinMan.help

require 'json'
STDOUT.sync = true # flush puts() output immediately after writing

require 'listen'
Listen.to! '.', :relative_paths => true do |modified, added, removed|
  files = modified + added
  puts JSON.dump(files) unless files.empty?
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tork-20.0.1 bin/tork-herald