Skip to content

Commit

Permalink
Release 1.0.0-alpha1
Browse files Browse the repository at this point in the history
  • Loading branch information
peterrehm committed Dec 15, 2014
1 parent c2d8678 commit 1dcf173
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Changelog
=========

* 1.0.0-alpha1
* feature #2 Added changelog command (peterrehm)
* feature #1 Added sha2pr command to show merge commit information (peterrehm)
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,19 @@ Start with
to setup your GitHub token.

Afterwards use `./gh` to get an overview over the available functions.

Installation
============

`gh` can be installed via composer.

````
composer global require 'peterrehm/gh=dev-master'
````

Make sure you have defined the following export path as well:

````
export PATH=~/.composer/vendor/bin:$PATH
````

6 changes: 6 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,11 @@
"psr-4" : {
"peterrehm\\gh\\" : "src"
}
},
"bin": [
"gh"
],
"config": {
"bin-dir": "bin"
}
}
14 changes: 13 additions & 1 deletion gh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@

use peterrehm\gh\Console\Application;

require __DIR__ . '/vendor/autoload.php';
function register_autoloader(array $loaders)
{
foreach ($loaders as $loader) {
if (file_exists($loader)) {
require ($loader);
return;
}
}

throw new RuntimeException('No autoloader has been found.');
}

register_autoloader([ __DIR__.'/vendor/autoload.php', __DIR__.'/../../autoload.php']);

$application = new Application();
$application->run();
6 changes: 6 additions & 0 deletions src/Command/ChangelogCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ public function execute(InputInterface $input, OutputInterface $output)
$output->writeln(sprintf('<comment>Changelog</comment> for reference range <info>%s</info>:', $referenceRange));
}

// skip if no changes have been detected
if (empty($changelog)) {
$output->writeln('No merge commits have been found.');
return;
}

$changelog = explode(PHP_EOL, $changelog);
foreach ($changelog as $entry) {
$output->writeln('* ' . $entry);
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class Application extends BaseApplication
{
const NAME = 'gh';
const VERSION = '1.0-alpha1';
const VERSION = '1.0.0-alpha1';

/**
* @var Client
Expand Down

0 comments on commit 1dcf173

Please sign in to comment.