Skip to content

Commit

Permalink
throw exception
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed Aug 8, 2023
1 parent 2a08c75 commit e4dd8dd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Stache/Stores/GlobalsStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Statamic\Facades\GlobalSet;
use Statamic\Facades\Path;
use Statamic\Facades\Stache;
use Statamic\Facades\YAML;
use Statamic\Support\Arr;
use Symfony\Component\Finder\SplFileInfo;
Expand All @@ -15,6 +16,15 @@ public function key()
return 'globals';
}

public function paths()
{
if ($this->directory !== Stache::store('global-variables')->directory()) {
throw new \Exception('The [globals] and [global-variables] Stache stores must share the same directory.');
}

return parent::paths();
}

public function getItemFilter(SplFileInfo $file)
{
// The global sets themselves should only exist in the root
Expand Down

0 comments on commit e4dd8dd

Please sign in to comment.