diff --git a/README.md b/README.md index 1d4ec1f..da4a840 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ Type: `boolean` Default: `true` -Use the `/tmp/` directory for your workflow cache when `true`. When `false` it will use the path in the `alfred_workflow_cache` environment variable as cache directory, which is set by Alfred by default. You can override this environment variable if you like to set a custom cache directory. +Use the OS temp directory for your workflow cache when `true`, otherwise use the directory set by Alfred in the`alfred_workflow_cache` environment variable. It's recommended to leave this set at `true` unless you want your cache to survive reboots and clean it up yourself every once in a while. ### Properties @@ -138,10 +138,13 @@ Type: `Object` Collection of Alfred metadata that is available to the script through environment variables. See the alfred documentation for more info: https://www.alfredapp.com/help/workflows/script-environment-variables/. +When you use a custom Alfred theme, the `themeFile` property will be set to the path of the theme file (which is a JSON file). Also see [Hugo.alfredTheme](#hugo.alfredtheme). + ```javascript { version: process.env.alfred_version, theme: process.env.alfred_theme, + themeFile: '', themeBackground: process.env.alfred_theme_background, themeSelectionBackground: process.env.alfred_theme_selection_background, themeSubtext: parseFloat(process.env.alfred_theme_subtext), @@ -152,6 +155,12 @@ Collection of Alfred metadata that is available to the script through environmen ``` *Also see: [Hugo.workflowMeta](#hugo.workflowmeta)* +#### Hugo.alfredTheme + +Type: `Object` + +When a custom Alfred theme is used, this will return the contents of the theme file. Usefull if you need to render icons on-the-fly and want to know the background colour. + #### Hugo.cache Type: [`cache-conf `](https://github.com/samverschueren/cache-conf) @@ -316,6 +325,12 @@ Check out [file-cache.js.flow](file-cache.js.flow) and the [example](examples/fi Checks for workflow package updates on either NPM or Packal when enabled. No need to call this method manually, updates will be checked automagically ​:sparkles:​ +#### Hugo.clearCache() + +Empties the workflow cache directory but doesn't remove the directory itself. + +Call `Hugo.clearCacheSync()` if you need it synchronously. + #### Hugo.filterItems(query, options) Fuzzy filter the output buffer by search query using Fuse.js. Add items to the output buffer first and then call `filterItems` to remove the items that do not match the search query. This method alters the output buffer directly.