Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/droath/robo-command-builder
Build Robo task commands from a single definition file.
https://github.com/droath/robo-command-builder
Last synced: 7 days ago
JSON representation
Build Robo task commands from a single definition file.
- Host: GitHub
- URL: https://github.com/droath/robo-command-builder
- Owner: droath
- Created: 2019-09-29T18:49:42.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-08-11T17:02:21.000Z (over 1 year ago)
- Last Synced: 2024-10-20T09:18:55.785Z (29 days ago)
- Language: PHP
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
The robo command builder is a utility that allows commands to be defined in a definition file. Once the commands have been defined they'll be able to be called via a PHP method.
The command definition allows for the following directives:
* binary - string (required)
* commands - array (required)
Each command action will be able to define their arguments and/or options. The `arguments` definition is a single key array.command.yml
```yaml
...
commands:
upload :
arguments:
- file
```
Which you would be able to use within a Robo task class.
```php
task(
CommandBuilder::class, 'upload', $pathToConfig, null
);$task->file(/path/to/file)->run();
````The `options` definition can be either a single key array, which defaults to a boolean type. If you need to define more options then you'll need to use an array of objects. The following parameters exist in the option object:
* name - The option name (required)
* type - The option type (optional - defaults to boolean)
* default - The option default value (optional)**Option Types:**
* array
* string
* integer
* boolean```yaml
binary: ddev
commands:
import-db:
options:
- { "name": "progress" }
- { "name": "extract-path" }
- { "name": "src", "type": "string" }
```