forked from consolidation/robo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
robo.script
executable file
·44 lines (43 loc) · 1.22 KB
/
robo.script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env robo
<?php
/**
* Robo script.
*
* This file may be executed from the shell as if it were a bash script.
*
* Example:
*
* $ ./robo.script foo bar
* ➜ This is a Robo script, bar
*
* If the script has only one command, then you may remove the need to
* specify it on the commandline by naming it on the `#!` line.
*
* e.g. if the first line is `#!/usr/bin/env robo foo`:
*
* $ ./robo.script bar
* ➜ This is a Robo script, bar
*
* Note that in order for Robo scripts to work, the 'robo' application
* must be in your $PATH. Usually, this is done by installing
* Robo via `composer global require`, and placing ~/.composer/vendor/bin
* on your $PATH. Robo libraries that are also installed via `composer global
* require` will be available for use in your Robo scripts, provided that
* they are loaded via the `getServiceProviders` method of the script.
*
* See also: https://github.com/consolidation-org/cgr
*/
class MyRoboScript extends \Robo\Tasks
{
/**
* Foo
*
* A demonstration of a command in a Robo script.
*
* @param string $name a name that is printed.
*/
public function foo($name)
{
$this->say("This is a Robo script, $name");
}
}