Skip to content

Commit

Permalink
Better naming.
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Jun 7, 2024
1 parent 66e2258 commit 9497199
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion resources/doc/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ You can define the custom directory for `package.json` file with the option `roo
{
"config": {
"foxy": {
"root-package-dir": "./module/theme"
"root-package-json-dir": "module/theme"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Asset/AbstractAssetManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function run(): int
return 0;
}

$rootPackageDir = $this->config->get('root-package-dir');
$rootPackageDir = $this->config->get('root-package-json-dir');

if (is_string($rootPackageDir) && !empty($rootPackageDir)) {
if (!is_dir($rootPackageDir)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Util/AssetUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static function getPath(
if (null !== $composerJsonPath && \file_exists($composerJsonPath)) {
/** @var array[] $composerJson */
$composerJson = \json_decode(\file_get_contents($composerJsonPath), true);
$rootPackageDir = $composerJson['config']['foxy']['root-package-dir'] ?? null;
$rootPackageDir = $composerJson['config']['foxy']['root-package-json-dir'] ?? null;

if (null !== $installPath && \is_string($rootPackageDir)) {
$installPath .= '/' . $rootPackageDir;
Expand Down
6 changes: 3 additions & 3 deletions tests/Asset/AssetManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,11 @@ public function testSpecifyCustomDirectoryFromPackageJson(): void
{
$this->config = new Config(
[],
['run-asset-manager' => true, 'root-package-dir' => $this->cwd],
['run-asset-manager' => true, 'root-package-json-dir' => $this->cwd],
);
$this->manager = $this->getManager();

$this->assertSame($this->cwd, $this->config->get('root-package-dir'));
$this->assertSame($this->cwd, $this->config->get('root-package-json-dir'));
$this->assertSame(0, $this->getManager()->run());
}

Expand All @@ -309,7 +309,7 @@ public function testSpecifyCustomDirectoryFromPackageJsonException(): void

$this->config = new Config(
[],
['run-asset-manager' => true, 'root-package-dir' => 'path/to/invalid'],
['run-asset-manager' => true, 'root-package-json-dir' => 'path/to/invalid'],
);
$this->manager = $this->getManager();

Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/package/global/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"config": {
"foxy": {
"root-package-dir": "theme",
"root-package-json-dir": "theme",
"global-composer-foo": 70,
"global-composer-bar": 70
}
Expand Down

0 comments on commit 9497199

Please sign in to comment.