# cp.sourcewatcher

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


# API Overview

Methods - API calls which can only be made on an object returned by a constructor

  • filesChanged
  • matchesExtensions
  • new
  • start
  • stop
  • watchPath

# 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
Notes None
Examples None
Source src/extensions/cp/sourcewatcher/init.lua line 67

# 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
Notes None
Examples None
Source src/extensions/cp/sourcewatcher/init.lua line 39

# new

Signature cp.sourcewatcher.new(extensions) -> sourcewatcher
Type Method
Description Creates a new sourcewatcher instance.
Parameters
  • extensions - Extensions
Returns
  • A sourcewatcher instance
Notes None
Examples None
Source src/extensions/cp/sourcewatcher/init.lua line 20

# start

Signature cp.sourcewatcher:start() -> none
Type Method
Description Starts a Source Watcher.
Parameters
  • None
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/sourcewatcher/init.lua line 129

# stop

Signature cp.sourcewatcher:stop() -> none
Type Method
Description Stops a Source Watcher.
Parameters
  • None
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/sourcewatcher/init.lua line 112

# 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
Notes None
Examples None
Source src/extensions/cp/sourcewatcher/init.lua line 93