mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-24 07:46:39 +00:00
*BREAKING*: Remove support for plugins entirely
There are very few plugins in real-world use, we're not actively working on this at all, and the current approach won't work once we move to standalone node-less binary installation anyway. Change-Type: major
This commit is contained in:
parent
163684e3a9
commit
079ce552e3
@ -81,13 +81,6 @@ _(Typically useful, but not strictly required for all commands)_
|
||||
Take a look at the full command documentation at [https://docs.resin.io/tools/cli/](https://docs.resin.io/tools/cli/#table-of-contents
|
||||
), or by running `resin help`.
|
||||
|
||||
---
|
||||
|
||||
Plugins
|
||||
-------
|
||||
|
||||
The Resin CLI can be extended with plugins to automate laborious tasks and overall provide a better experience when working with Resin.io. Check the [plugin development tutorial](https://github.com/resin-io/resin-plugin-hello) to learn how to build your own!
|
||||
|
||||
FAQ
|
||||
---
|
||||
|
||||
|
@ -55,8 +55,6 @@ general = (params, options, done) ->
|
||||
return command.hidden or command.isWildcard()
|
||||
|
||||
groupedCommands = _.groupBy commands, (command) ->
|
||||
if command.plugin
|
||||
return 'plugins'
|
||||
if command.primary
|
||||
return 'primary'
|
||||
return 'secondary'
|
||||
@ -64,10 +62,6 @@ general = (params, options, done) ->
|
||||
print(parse(groupedCommands.primary))
|
||||
|
||||
if options.verbose
|
||||
if not _.isEmpty(groupedCommands.plugins)
|
||||
console.log('\nInstalled plugins:\n')
|
||||
print(parse(groupedCommands.plugins))
|
||||
|
||||
console.log('\nAdditional commands:\n')
|
||||
print(parse(groupedCommands.secondary))
|
||||
else
|
||||
|
@ -74,7 +74,6 @@ resin = require('resin-sdk-preconfigured')
|
||||
actions = require('./actions')
|
||||
errors = require('./errors')
|
||||
events = require('./events')
|
||||
plugins = require('./utils/plugins')
|
||||
update = require('./utils/update')
|
||||
|
||||
# Assign bluebird as the global promise library
|
||||
@ -209,9 +208,7 @@ capitano.command(actions.deploy)
|
||||
|
||||
update.notify()
|
||||
|
||||
plugins.register(/^resin-plugin-(.+)$/).then ->
|
||||
cli = capitano.parse(process.argv)
|
||||
|
||||
runCommand = ->
|
||||
if cli.global?.help
|
||||
capitanoExecuteAsync(command: "help #{cli.command ? ''}")
|
||||
@ -219,5 +216,4 @@ plugins.register(/^resin-plugin-(.+)$/).then ->
|
||||
capitanoExecuteAsync(cli)
|
||||
|
||||
Promise.all([events.trackCommand(cli), runCommand()])
|
||||
|
||||
.catch(errors.handle)
|
||||
|
@ -1,36 +0,0 @@
|
||||
/*
|
||||
Copyright 2016-2017 Resin.io
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import nplugm = require('nplugm');
|
||||
import _ = require('lodash');
|
||||
import capitano = require('capitano');
|
||||
import patterns = require('./patterns');
|
||||
|
||||
export function register(regex: RegExp): Promise<void> {
|
||||
return nplugm
|
||||
.list(regex)
|
||||
.map(async function(plugin: any) {
|
||||
const command = await import(plugin);
|
||||
command.plugin = true;
|
||||
if (!_.isArray(command)) {
|
||||
return capitano.command(command);
|
||||
}
|
||||
return _.each(command, capitano.command);
|
||||
})
|
||||
.catch((error: Error) => {
|
||||
return patterns.printErrorMessage(error.message);
|
||||
});
|
||||
}
|
@ -114,7 +114,6 @@
|
||||
"moment": "^2.12.0",
|
||||
"mz": "^2.6.0",
|
||||
"node-cleanup": "^2.1.2",
|
||||
"nplugm": "^3.0.0",
|
||||
"opn": "^5.1.0",
|
||||
"president": "^2.0.1",
|
||||
"prettyjson": "^1.1.3",
|
||||
|
Loading…
Reference in New Issue
Block a user