Skip to content

Commit d3f6ec7

Browse files
committed
Update AutocompleteCommand.php
1 parent 70aee52 commit d3f6ec7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/Commands/AutocompleteCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ public function handle(): void
3030
File::ensureDirectoryExists(storage_path($dir));
3131
$now = now()->format('Y-m-d-H-i-s');
3232

33-
File::put(storage_path("{$dir}/full-{$now}.json"), $result->toJson(JSON_PRETTY_PRINT));
34-
File::put(storage_path("{$dir}/autocomplete-{$now}.json"), json_encode($autocompleting->flip(), JSON_PRETTY_PRINT));
35-
3633
if (!$this->option('from-file')) {
37-
File::put(storage_path("{$dir}/autocomplete-{$now}.php"), $code);
34+
File::put(storage_path("{$dir}/{$now}-01-code.php"), $code);
3835
}
36+
37+
File::put(storage_path("{$dir}/{$now}-02-autocomplete.json"), json_encode($autocompleting?->flip() ?? [], JSON_PRETTY_PRINT));
38+
File::put(storage_path("{$dir}/{$now}-03-full.json"), $result->toJson(JSON_PRETTY_PRINT));
3939
}
4040

41-
echo json_encode($autocompleting->flip(), $this->option('debug') ? JSON_PRETTY_PRINT : 0);
41+
echo json_encode($autocompleting?->flip() ?? [], $this->option('debug') ? JSON_PRETTY_PRINT : 0);
4242

4343
// dd($autocompleting->flip(), 'Autocompleting');
4444
// // $toAutocomplete = $this->findFirstAutocompleting($result->toArray()['children']);

0 commit comments

Comments
 (0)