Skip to content

Watching tools


directoryWatch

Watch a directory for changes.

Usage

directoryWatch [ --help ] [ --handler handler ] [ --verbose ] [ --file modifiedFile ] [ --modified modifiedTimestamp ] [ --timeout secondsToRun ] [ --state stateFile ] directory [ findArguments ... ]

Watch a directory for changes and exit when changes are found. Pass --file (and optionally --modified) if you know the most recently modified file to use.

Location: bin/build/tools/watch.sh

Arguments

  • --help - Flag. Optional. Display this help.
  • --handler handler - Function. Optional. Use this error handler instead of the default error handler.
  • --verbose - Flag. Optional. Be verbose.
  • --file modifiedFile - File. Optional. Last known modified file in this directory.
  • --modified modifiedTimestamp - UnsignedInteger. Optional. Last known modification timestamp in this directory. Requires --file passed as well.
  • --timeout secondsToRun - UnsignedInteger. Optional. Number of seconds to run until exiting. Leave blank to run forever.
  • --state stateFile - File. Optional. Output of fileModificationTimes will be saved here (and modified). First line of which is the most recently modified timestamp and file name.
  • directory - Directory. Required. Directory to watch.
  • findArguments ... - Arguments. Optional. Passed to find to filter the files examined.

Return codes

  • 0 - Success
  • 1 - Environment error
  • 2 - Argument error

🛠️ Tools · ⬅ Top