docs » cp.sourcewatcher


Watches folders for specific file extensions and reloads the app if they change.

API Overview

API Documentation

Methods

filesChanged

Signature cp.sourcewatcher:filesChanged(files, flagTables) -> boolean
Type Method
Description Checks that the file that triggered the Path Watcher matches the extension given.
Parameters
  • `files` - Table of files to check as strings
  • `flagTables` - Table of flagTables (see: `hs.pathwatcher.new`)
Returns
  • None

matchesExtensions

Signature cp.sourcewatcher:matchesExtensions(file) -> boolean
Type Method
Description Checks that the file that triggered the Path Watcher matches the extension given.
Parameters
  • `file` - The file as string
Returns
  • A boolean value

new

Signature cp.sourcewatcher.new(extensions) -> sourcewatcher
Type Method
Description Creates a new sourcewatcher instance.
Parameters
  • `extensions` - Extensions
Returns
  • A sourcewatcher instance

start

Signature cp.sourcewatcher:start() -> none
Type Method
Description Starts a Source Watcher.
Parameters
  • None
Returns
  • None

stop

Signature cp.sourcewatcher:stop() -> none
Type Method
Description Stops a Source Watcher.
Parameters
  • None
Returns
  • None

watchPath

Signature cp.sourcewatcher:watchPath(path) -> sourcewatcher
Type Method
Description Watches a path.
Parameters
  • `path` - The path you want to watch as a string.
Returns
  • sourcewatcher

results matching ""

    No results matching ""