Skip to content

Commit e760980

Browse files
authored
Create missing baseline directories (#7)
1 parent 4fc9536 commit e760980

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

config/translation-linter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
| option when running the command.
100100
|
101101
*/
102-
'baseline' => base_path('translations.unused.baseline.json'),
102+
'baseline' => lang_path('.lint/unused.json'),
103103

104104
/*
105105
|--------------------------------------------------------------------------

src/Collections/ResultObjectCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function reset(): void
1616
$this->items = [];
1717
}
1818

19-
public function toBaseLineJson(): string
19+
public function toBaselineJson(): string
2020
{
2121
return $this
2222
->groupBy('locale')

src/Contracts/Collections/ResultObjectCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface ResultObjectCollection extends Arrayable, Enumerable
1616
{
1717
public function reset(): void;
1818

19-
public function toBaseLineJson(): string;
19+
public function toBaselineJson(): string;
2020

2121
public function toCommandTableOutputArray(FieldCollectionContract $fields): array;
2222

src/Writers/UnusedBaselineFileWriter.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ public function __construct(
1515

1616
public function execute(ResultObjectCollection $results)
1717
{
18-
$this->filesystem->put(
19-
$this->file,
20-
$results->toBaseLineJson(),
21-
);
18+
$path = $this->filesystem->dirname($this->file);
19+
20+
$this->filesystem->ensureDirectoryExists($path);
21+
22+
$this->filesystem->put($this->file, $results->toBaselineJson());
2223
}
2324
}

0 commit comments

Comments
 (0)