Skip to content

Commit 1006002

Browse files
committed
change success message for rename command
1 parent 9f94357 commit 1006002

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Commands/RenameCommand.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function handle()
6161

6262
$this->listFilesContainingOldKey();
6363

64-
$this->info("Done!");
64+
$this->info('The key at '.$this->argument('oldKey').' was renamed to'.$this->argument('newKey').' successfully!');
6565
}
6666

6767
/**
@@ -79,10 +79,16 @@ private function renameKey()
7979
return;
8080
}
8181

82-
$files = $this->manager->files()[$file];
82+
if (Str::contains($this->argument('newKey'), '.')) {
83+
$this->error('Please provide the new key must not contain a dot.');
84+
85+
return;
86+
}
8387

8488
$newKey = preg_replace('/(\w+)$/i', $this->argument('newKey'), $key);
8589

90+
$files = $this->manager->files()[$file];
91+
8692
$currentValues = [];
8793

8894
foreach ($files as $languageKey => $filePath) {

0 commit comments

Comments
 (0)