Context API
Includes the following properties:
- appPath: Path to running Local by Flywheel.app
- userHome: Path to current user home directory
- phpVersion: Available PHP versions in Local
- version: Local version
- dockerPath: Path to Docker binary in Local by Flywheel.app
- userDataPath: Path to Local's user data folder. On macOS this defaults to
~/Library/Application Support/Local by Flywheel
Use
context.hooks
to run actions at certain times. Hooks are especially useful when adding in element with context.React
.Exposes Electron API. The available methods and classes will differ based on whether or not this is ran from the main process or renderer process.
With the Electron API you can create dialogs, open new windows, and more.
context.notifier.notify({
title: 'Notification Title',
message: 'This is an example notification message.',
});
Renderer Only
context.React
required to use JSX in your renderer entry point. You can also use context.React
to access React's Top-Level API.The following contexts have been deprecated in the most recent versions of Local.
Use
context.docker
to run Docker commands.context.docker(`start ${container}`).then(stdout => {
//Success
}).catch(({stdout, stderr}) => {
//Something bad happened
});
Last modified 2yr ago