Skip to content

Commit

Permalink
Update TransExportCommend.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ShibuyaKosuke authored Nov 6, 2022
1 parent 1288539 commit c74d6ea
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Console/TransExportCommend.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

/**
* Class TransExportCommend
*
* @package ShibuyaKosuke\LaravelDdlExport\Console
*/
class TransExportCommend extends Command
Expand Down Expand Up @@ -48,13 +49,15 @@ public function handle(): void

CreateView::down();

$locale = App::getLocale();
$dir = App::langPath($locale);
$locale = \App::getLocale();
$dir = \App::langPath($locale);

if (!file_exists($dir) && !mkdir($dir, true) && !is_dir($dir)) {
throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
}

$file = $dir . '/columns.php';

File::put(
$file,
sprintf("<?php\n\nreturn %s;\n", Arr::export($response))
Expand Down

0 comments on commit c74d6ea

Please sign in to comment.