Skip to content

Commit 8827135

Browse files
author
Serhii Polishchuk
committed
Move certificationy console command to bin directory
1 parent cb659b3 commit 8827135

3 files changed

Lines changed: 19 additions & 9 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,28 @@ This is the CLI tool to train on certifications.
1515
## Using Composer
1616
```
1717
$ composer create-project certificationy/certificationy-cli
18-
$ php certificationy.php
18+
$ bin/certificationy
1919
```
2020

2121
## More run options
2222

2323
### Select the number of questions
2424
```
25-
$ php certificationy.php start --number=10
25+
$ bin/certificationy start --number=10
2626
```
2727

2828
The default value is 20.
2929

3030
### List categories
3131
```
32-
$ php certificationy.php start --list [-l]
32+
$ bin/certificationy start --list [-l]
3333
```
3434

3535
Will list all the categories available
3636

3737
### Only questions from certain categories
3838
```
39-
$ php certificationy.php start "Automated tests" "Bundles"
39+
$ bin/certificationy start "Automated tests" "Bundles"
4040
```
4141

4242
Will only get the questions from the categories "Automated tests" and "Bundles"
@@ -45,14 +45,14 @@ Use the category list from [List categories](#list-categories)
4545

4646
### Show if a question has multiple choices
4747
```
48-
$ php certificationy.php start --show-multiple-choice
48+
$ bin/certificationy start --show-multiple-choice
4949
```
5050

5151
![Multiple choices](https://cloud.githubusercontent.com/assets/795661/3308225/721b5324-f679-11e3-8d9d-62ba32cd8e32.png "Multiple choices")
5252

5353
### And all combined
5454
```
55-
$ php certificationy.php start --number=5 --show-multiple-choice "Automated tests" "Bundles"
55+
$ bin/certificationy start --number=5 --show-multiple-choice "Automated tests" "Bundles"
5656
```
5757

5858
* 5 questions
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@
1111
* file that was distributed with this source code.
1212
*/
1313

14-
require __DIR__ . '/vendor/autoload.php';
14+
$autoloadFiles = array(__DIR__.'/../vendor/autoload.php',
15+
__DIR__.'/../../../autoload.php');
16+
17+
foreach ($autoloadFiles as $autoloadFile) {
18+
if (file_exists($autoloadFile)) {
19+
require_once $autoloadFile;
20+
}
21+
}
1522

1623
use Certificationy\Cli\Command\StartCommand;
1724
use KevinGH\Amend\Command;
@@ -24,7 +31,7 @@
2431

2532
$application = new Application(APPLICATION_NAME, VERSION);
2633

27-
$config = Yaml::parse(file_get_contents('config.yml'));
34+
$config = Yaml::parse(file_get_contents(__DIR__.'/../config.yml'));
2835
$updateCommand = new Command('self-update');
2936
$updateCommand->setManifestUri($config['manifest_uri']);
3037
$application->add($updateCommand);

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,8 @@
4242
"branch-alias": {
4343
"dev-master": "1.0.x-dev"
4444
}
45-
}
45+
},
46+
"bin": [
47+
"bin/certificationy"
48+
]
4649
}

0 commit comments

Comments
 (0)