Skip to content

Commit

Permalink
Add an option to show/open the zazu config.
Browse files Browse the repository at this point in the history
  • Loading branch information
Blaine Schmeisser committed Jan 9, 2017
1 parent a29eb41 commit 84e42b0
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 0 deletions.
7 changes: 7 additions & 0 deletions readme.md
Expand Up @@ -34,3 +34,10 @@ To list all installed plugins type in `list`, which also accepts an argument.
Clicking one will go to the plugin homepage.

![list](./screenshots/list.png)

### Show Config

To open the folder containing the config, or to open the config in your default
`.json` editor, try `config`:

![config](./screenshots/config.png)
Binary file added screenshots/config.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions src/openConfig.js
@@ -0,0 +1,13 @@
module.exports = (pluginContext) => {
return (query, env = {}) => {
return new Promise((resolve, reject) => {
resolve([
{
icon: 'fa-file-text',
title: 'Open Zazu Configuration',
value: '~/.zazurc.json',
}
])
})
}
}
13 changes: 13 additions & 0 deletions src/showConfig.js
@@ -0,0 +1,13 @@
module.exports = (pluginContext) => {
return (query, env = {}) => {
return new Promise((resolve, reject) => {
resolve([
{
icon: 'fa-file-text',
title: 'Show Zazu Configuration',
value: '~/.zazurc.json',
}
])
})
}
}
26 changes: 26 additions & 0 deletions zazu.json
Expand Up @@ -37,6 +37,24 @@
"args": "Optional",
"script": "src/list.js",
"connections": ["GotoRepo"]
},
{
"id": "ShowConfig",
"type": "PrefixScript",
"prefix": "config",
"space": false,
"args": "None",
"script": "src/showConfig.js",
"connections": ["ShowFile"]
},
{
"id": "OpenConfig",
"type": "PrefixScript",
"prefix": "config",
"space": false,
"args": "None",
"script": "src/openConfig.js",
"connections": ["OpenFile"]
}
],
"output": [
Expand All @@ -62,6 +80,14 @@
"type": "SendNotification",
"title": "Packages Updated",
"message": "Your packages have been updated. Reload your configuration to see your changes."
},
{
"id": "ShowFile",
"type": "ShowFile"
},
{
"id": "OpenFile",
"type": "OpenFile"
}
]
}
Expand Down

0 comments on commit 84e42b0

Please sign in to comment.