Skip to content

Commit 6b16f3d

Browse files
committed
Fixed #92
1 parent 240f5b7 commit 6b16f3d

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

Console/Command/AbstractCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace JetRails\Cloudflare\Console\Command;
44

55
use Magento\Store\Model\StoreManagerInterface;
6+
use Magento\Framework\Console\Cli;
67
use Symfony\Component\Console\Command\Command;
78
use Symfony\Component\Console\Input\InputInterface;
89
use Symfony\Component\Console\Output\OutputInterface;
@@ -89,7 +90,7 @@ public function execute ( InputInterface $input, OutputInterface $output ) {
8990
$domain = $input->getOption ("domain");
9091
if ( !$domain ) {
9192
$output->writeln ("Error: please pass domain name with --domain option.");
92-
return $this;
93+
return Cli::RETURN_FAILURE;
9394
}
9495
$domains = $this->_getDomainNames ();
9596
if ( !in_array ( $domain, $domains ) ) {
@@ -99,9 +100,10 @@ public function execute ( InputInterface $input, OutputInterface $output ) {
99100
$output->writeln ("- $d");
100101
}
101102
$output->writeln ("");
102-
return $this;
103+
return Cli::RETURN_FAILURE;
103104
}
104105
$this->runCommand ( $input, $output );
106+
return Cli::RETURN_SUCCESS;
105107
}
106108

107109
protected abstract function runCommand (

Console/Command/SetAuth.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Magento\Framework\App\Config\ScopeConfigInterface;
1010
use Magento\Framework\App\Config\Storage\WriterInterface;
1111
use Magento\Framework\Encryption\EncryptorInterface;
12+
use Magento\Framework\Console\Cli;
1213
use Magento\Store\Model\ScopeInterface;
1314
use Magento\Store\Model\StoreManagerInterface;
1415
use Symfony\Component\Console\Command\Command;
@@ -162,15 +163,15 @@ public function execute ( InputInterface $input, OutputInterface $output ) {
162163
$token = $input->getOption ("token");
163164
if ( !$domain ) {
164165
$output->writeln ("Error: please pass domain name with --domain option.");
165-
return $this;
166+
return Cli::RETURN_FAILURE;
166167
}
167168
if ( !$zone ) {
168169
$output->writeln ("Error: please pass zone name with --zone option.");
169-
return $this;
170+
return Cli::RETURN_FAILURE;
170171
}
171172
if ( !$token ) {
172173
$output->writeln ("Error: please pass token name with --token option.");
173-
return $this;
174+
return Cli::RETURN_FAILURE;
174175
}
175176
$domains = $this->_getDomainNames ();
176177
if ( !in_array ( $domain, $domains ) ) {
@@ -180,11 +181,12 @@ public function execute ( InputInterface $input, OutputInterface $output ) {
180181
$output->writeln ("- $d");
181182
}
182183
$output->writeln ("");
183-
return $this;
184+
return Cli::RETURN_FAILURE;
184185
}
185186
$this->_setAuthZone ( $zone, $domain );
186187
$this->_setAuthToken ( $token, $domain );
187188
$output->writeln ("Successfully saved zone and token for domain $domain.");
189+
return Cli::RETURN_SUCCESS;
188190
}
189191

190192
}

docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ services:
1212
magento:
1313
image: docker.io/bitnami/magento:2
1414
environment:
15-
- MAGENTO_HOST=localhost
15+
- MAGENTO_HOST=howtospeedupmagento.com
1616
- MAGENTO_DATABASE_HOST=mariadb
1717
- MAGENTO_DATABASE_PORT_NUMBER=3306
1818
- MAGENTO_DATABASE_USER=magento2

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,9 +2084,9 @@ caniuse-api@^3.0.0:
20842084
lodash.uniq "^4.5.0"
20852085

20862086
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001219:
2087-
version "1.0.30001228"
2088-
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz#bfdc5942cd3326fa51ee0b42fbef4da9d492a7fa"
2089-
integrity sha512-QQmLOGJ3DEgokHbMSA8cj2a+geXqmnpyOFT0lhQV6P3/YOJvGDEwoedcwxEQ30gJIwIIunHIicunJ2rzK5gB2A==
2087+
version "1.0.30001478"
2088+
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001478.tgz"
2089+
integrity sha512-gMhDyXGItTHipJj2ApIvR+iVB5hd0KP3svMWWXDvZOmjzJJassGLMfxRkQCSYgGd2gtdL/ReeiyvMSFD1Ss6Mw==
20902090

20912091
caseless@~0.12.0:
20922092
version "0.12.0"

0 commit comments

Comments
 (0)