BuildCache

BuildCache

Filesystem-level cache of grunt build output, keyed by (pluginHash, theme, menu). One instance per cache root; methods are stateless beyond the root path.

Constructor

new BuildCache(cacheRoot)

Source:
Parameters:
Name Type Description
cacheRoot String Root cache directory

Methods

getPath() → {String}

Source:
Returns:
The cache directory path for the given combo
Type
String

(async) has() → {Promise.<Boolean>}

Source:
Returns:
Whether a cached build exists for the given combo
Type
Promise.<Boolean>

(async) invalidate()

Description:
  • Removes the entire cache root.
Source:

(async) populate(buildOutputDir)

Description:
  • Copies the build output (minus per-course content) into the cache for the given combo. Uses a temp dir + atomic rename for parallel safety.
Source:
Parameters:
Name Type Description
buildOutputDir String The build output directory

(async) restore(destDir)

Description:
  • Copies cached artifacts to a build directory.
Source:
Parameters:
Name Type Description
destDir String Destination build directory