Documentation
¶
Overview ¶
Package build provides helpers for developing and building workflows.
Info provides Alfred and workflow settings, read from the environment, info.plist and Alfred's config files.
There are also utility functions to help build workflows:
Symlink() // symlink files Export() // create an .alfredworkflow file from a directory
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Export ¶
Export builds an .alfredworkflow file in directory dest from the files in directory src. If src is an empty string, "build" is used; if dest is empty, "dist" is used.
The filename of the workflow file is generated automatically from the workflow's info.plist and is returned if zipping succeeds.
func SymlinkGlobs ¶
SymlinkGlobs symlinks multiple Globs to a directory.
Types ¶
type Glob ¶
type Glob struct { // Pattern is a glob-style pattern to match against filesystem Pattern string // DestDir is a relative directory within target directory // to where files matching Pattern should be linked. DestDir string }
Glob is a pattern and (relative) destination directory.
type Info ¶
type Info struct { // Workflow info read from environment variables/info.plist Name string // Workflow name Version string // Workflow version BundleID string // Workflow bundle ID // Workflow directories CacheDir string // Workflow cache directory DataDir string // Workflow data directory // Where workflow should be installed. This is // Alfred's workflow directory (AlfredWorkflowDir) // plus workflow's bundle ID. InstallDir string // Alfred info AlfredMajorVersion int // Alfred's major version number AlfredSyncDir string // Path of Alfred's syncfolder AlfredPrefsBundle string // Path to the Alfred.alfredpreferences bundle AlfredWorkflowDir string // Directory workflows are stored in AlfredCacheDir string // Root directory for all workflow cache data AlfredDataDir string // Root directory for all persistent workflow data // contains filtered or unexported fields }
Info contains information about a workflow and Alfred.
The information is extracted from environment variables, the workflow's info.plist, Alfred's own configuration files and finally, some defaults.
func NewInfo ¶
NewInfo creates a new Info. Workflow info is read from Alfred environment variables (if set), and from info.plist in the working directory and Alfred's configuration files. These paths may be changed using the the LibDir and InfoPlist Options. Settings from info.plist take priority over those from environment variables.
It returns an error if info.plist or the configuration files cannot be found.