Skip to content

Commit 36c8146

Browse files
committed
Merge branch 'feature/magerun'
2 parents 3991cf4 + b606061 commit 36c8146

5 files changed

Lines changed: 59 additions & 13 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
*.bz2
2+
*.gz
3+
*.sh
4+
*.zip
15
/composer.lock
26
/magedownload.phar
37
/vendor/

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@ curl -sS https://getcomposer.org/installer | php
2424
php composer.phar install
2525
```
2626

27+
### n98 magerun
28+
29+
* Clone to your modules directory
30+
* Install with composer
31+
32+
```
33+
mkdir -p ~/.n98-magerun/modules
34+
cd ~/.n98-magerun/modules
35+
git clone https://github.com/steverobbins/magedownload-cli
36+
cd magedownload-cli
37+
curl -sS https://getcomposer.org/installer | php
38+
php composer.phar install
39+
```
40+
2741
# Usage
2842

2943
$ php magedownload.phar help
@@ -57,9 +71,13 @@ Your Magento account ID.
5771

5872
Your Magento access token.
5973

60-
### `download`
74+
### `file`
75+
76+
$ php magedownload.phar file <name> <destination>
6177

62-
$ php magedownload.phar download <file> <destination>
78+
or
79+
80+
$ php n98-magerun.phar download:file <name> <destination>
6381

6482
Downloads the specified file to the given destination.
6583

@@ -69,6 +87,10 @@ If no destination is given, the file is downloaded to current directory.
6987

7088
$ php magedownload.phar info <action>
7189

90+
or
91+
92+
$ php n98-magerun.phar download:info <action>
93+
7294
Gets information about what releases and patches can be downloaded.
7395

7496
Available actions:

n98-magerun.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
autoloaders:
2+
MageDownload:
3+
- %module%/src
4+
- %module%/vendor/steverobbins/magedownload/src
5+
6+
commands:
7+
customCommands:
8+
- "download:file": MageDownload\Command\DownloadCommand
9+
- "download:info": MageDownload\Command\InfoCommand
10+
11+
autoloaders_psr4:
12+
GuzzleHttp\: %module%/vendor/guzzlehttp/guzzle/src
13+
GuzzleHttp\Psr7\: %module%/vendor/guzzlehttp/psr7/src
14+
GuzzleHttp\Promise\: %module%/vendor/guzzlehttp/promises/src
15+
Psr\Http\Message\: %module%/vendor/psr/http-message/src
16+
17+
autoload_files:
18+
- %module%/vendor/guzzlehttp/guzzle/src/functions_include.php
19+
- %module%/vendor/guzzlehttp/psr7/src/functions_include.php
20+
- %module%/vendor/guzzlehttp/promises/src/functions_include.php

src/MageDownload/Command/DownloadCommand.php renamed to src/MageDownload/Command/FileCommand.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
use Symfony\Component\Console\Output\OutputInterface;
2121

2222
/**
23-
* Download command
23+
* Download file command
2424
*
2525
* @category MageDownload
2626
* @package MageDownload
@@ -29,7 +29,7 @@
2929
* @license http://creativecommons.org/licenses/by/4.0/ CC BY 4.0
3030
* @link https://github.com/steverobbins/magedownload-cli
3131
*/
32-
class DownloadCommand extends AbstractCommand
32+
class FileCommand extends AbstractCommand
3333
{
3434
/**
3535
* Configure command
@@ -39,12 +39,12 @@ class DownloadCommand extends AbstractCommand
3939
protected function configure()
4040
{
4141
$this
42-
->setName('download')
42+
->setName('file')
4343
->setDescription('Download a release or patch')
4444
->addArgument(
45-
'file',
45+
'name',
4646
InputArgument::REQUIRED,
47-
'The file to download'
47+
'The name of the file to download'
4848
)
4949
->addArgument(
5050
'destination',
@@ -68,7 +68,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
6868
$output->writeln(sprintf('Downloading to <info>%s</info>...', $destination));
6969
$download = new Download;
7070
$result = $download->get(
71-
$input->getArgument('file'),
71+
$input->getArgument('name'),
7272
$this->getAccountId($input),
7373
$this->getAccessToken($input)
7474
);
@@ -91,13 +91,13 @@ private function getDestination(InputInterface $input)
9191
{
9292
$dest = $input->getArgument('destination');
9393
if (!$dest) {
94-
return getcwd() . DIRECTORY_SEPARATOR . $input->getArgument('file');
94+
return getcwd() . DIRECTORY_SEPARATOR . $input->getArgument('name');
9595
}
9696
if (is_dir($dest)) {
9797
if (substr($dest, -1) !== '/') {
9898
$dest .= DIRECTORY_SEPARATOR;
9999
}
100-
return $dest . $input->getArgument('file');
100+
return $dest . $input->getArgument('name');
101101
}
102102
return $dest;
103103
}

src/bootstrap.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414

1515
require_once __DIR__ . '/../vendor/autoload.php';
1616

17-
use MageDownload\Command\DownloadCommand;
17+
use MageDownload\Command\FileCommand;
1818
use MageDownload\Command\InfoCommand;
1919
use Symfony\Component\Console\Application;
2020

21-
$app = new Application('Magedownload CLI', '1.0.2');
21+
$app = new Application('Magedownload CLI', '1.1.0');
2222

23-
$app->add(new DownloadCommand);
23+
$app->add(new FileCommand);
2424
$app->add(new InfoCommand);
2525

2626
$app->run();

0 commit comments

Comments
 (0)