Skip to content

Commit ef0fb47

Browse files
committed
more migrating
1 parent 9413518 commit ef0fb47

10 files changed

Lines changed: 899 additions & 494 deletions

File tree

src/Commands/Concerns/InteractsWithFilesystem.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace STS\Keep\Commands\Concerns;
44

5+
use STS\Keep\Facades\Keep;
56
use function Laravel\Prompts\confirm;
67

78
trait InteractsWithFilesystem
@@ -35,11 +36,13 @@ protected function writeToFile(string $path, string $content, $overwrite = false
3536

3637
protected function findStageOverlayTemplate(): ?string
3738
{
38-
if (! config('keep.stage_templates')) {
39+
$stageTemplatesPath = Keep::getSetting('stage_templates');
40+
41+
if (! $stageTemplatesPath) {
3942
return null;
4043
}
4144

42-
$path = config('keep.stage_templates').'/'.$this->stage().'.env';
45+
$path = $stageTemplatesPath.'/'.$this->stage().'.env';
4346

4447
return file_exists($path) && is_readable($path) ? $path : null;
4548
}

src/Commands/ImportCommand.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ class ImportCommand extends BaseCommand
2525
public function process()
2626
{
2727
if ($this->option('overwrite') && $this->option('skip-existing')) {
28-
$this->error('You cannot use --overwrite and --skip-existing together.');
29-
30-
return self::FAILURE;
28+
return $this->error('You cannot use --overwrite and --skip-existing together.');
3129
}
3230

3331
$envFilePath = $this->argument('from') ?? text('Path to .env file', required: true);

src/Commands/MergeCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class MergeCommand extends BaseCommand
2727

2828
protected Template $overlayTemplate;
2929

30-
public function process(): int
30+
public function process()
3131
{
3232
if (! $this->prepareTemplateContents()) {
3333
return self::FAILURE;
@@ -117,7 +117,7 @@ protected function loadSecretsFromAllReferencedVaults($context): SecretCollectio
117117
$allSecrets = new SecretCollection();
118118

119119
foreach ($vaultNames as $vaultSlug) {
120-
$vault = Keep::vault($vaultSlug)->forStage($context->stage);
120+
$vault = Keep::vault($vaultSlug, $context->stage);
121121
$vaultSecrets = $vault->list();
122122
$allSecrets = $allSecrets->merge($vaultSecrets);
123123
}

src/KeepApplication.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ public function __construct(protected KeepInstall $install)
4949
$this->add((new Commands\HistoryCommand()));
5050

5151
$this->add((new Commands\ListCommand()));
52+
$this->add((new Commands\ImportCommand()));
5253
$this->add((new Commands\ExportCommand()));
54+
$this->add((new Commands\MergeCommand()));
5355

5456
$this->add((new Commands\DiffCommand()));
5557
$this->add((new Commands\VerifyCommand()));

tests-laravel-backup/Unit/KeepManagerTest.php

Lines changed: 0 additions & 175 deletions
This file was deleted.

0 commit comments

Comments
 (0)