Skip to content

Commit

Permalink
Fix wrong lock file reference
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Jan 29, 2024
1 parent 7c8d5ad commit 9cb79aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions app/src/Bakery/AssetsInstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected function configure(): void
$help = [
'This command will <info>install</info> npm dependencies defined in <info>package.json</info>.',
'It will automatically download and install the frontend dependencies in the <info>node_modules</info> directory.',
'This command doesn\'t update any dependencies. It will install the version locked in the <info>package.lock</info> file.',
'This command doesn\'t update any dependencies. It will install the version locked in the <info>package-lock.json</info> file.',
'Everything will be executed in the same dir the bakery command is executed.',
'For more info, see <comment>https://learn.userfrosting.com/asset-management</comment>',
];
Expand Down Expand Up @@ -86,14 +86,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
return self::SUCCESS;
}

// Check if package.lock exists
$lockFile = $path . '/package.lock';
// Check if package-lock.json exists
$lockFile = $path . '/package-lock.json';
if (!file_exists($lockFile)) {
$this->io->note("Lock file `$lockFile` not found. Will install latest versions.");
}

// Execute command
$this->io->section('Installing npm Dependencies');
if ($this->executeCommand('npm install') !== 0) {
$this->io->error('npm dependency installation has failed');

Expand Down
2 changes: 1 addition & 1 deletion app/src/Bakery/AssetsUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected function configure(): void
$help = [
'This command will <info>update</info> npm dependencies defined in <info>package.json</info>.',
'It will automatically download and install the latest version of frontend dependencies in the <info>node_modules</info> directory.',
'It will install the latest possible version, ignoring <info>package.lock</info> file.',
'It will install the latest possible version, ignoring <info>package-lock.json</info> file.',
'Everything will be executed in the same dir the bakery command is executed.',
'For more info, see <comment>https://learn.userfrosting.com/asset-management</comment>',
];
Expand Down
2 changes: 1 addition & 1 deletion app/tests/Unit/Bakery/AssetsInstallCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function testCommand(): void

// Assert some output
$this->assertSame(0, $result->getStatusCode());
$this->assertStringContainsString('Lock file `foo/package.lock` not found. Will install latest versions.', $result->getDisplay());
$this->assertStringContainsString('Lock file `foo/package-lock.json` not found. Will install latest versions.', $result->getDisplay());

Check failure on line 70 in app/tests/Unit/Bakery/AssetsInstallCommandTest.php

View workflow job for this annotation

GitHub Actions / PHPUnit - PHP 8.2 - Memory SQLite

Failed asserting that '\n

Check failure on line 70 in app/tests/Unit/Bakery/AssetsInstallCommandTest.php

View workflow job for this annotation

GitHub Actions / PHPUnit - PHP 8.1 - Memory SQLite

Failed asserting that '\n

Check failure on line 70 in app/tests/Unit/Bakery/AssetsInstallCommandTest.php

View workflow job for this annotation

GitHub Actions / PHPUnit - PHP 8.1 - SQLite

Failed asserting that '\n

Check failure on line 70 in app/tests/Unit/Bakery/AssetsInstallCommandTest.php

View workflow job for this annotation

GitHub Actions / PHPUnit - PHP 8.3 - MariaDB

Failed asserting that '\n

Check failure on line 70 in app/tests/Unit/Bakery/AssetsInstallCommandTest.php

View workflow job for this annotation

GitHub Actions / PHPUnit - PHP 8.3 - Memory SQLite

Failed asserting that '\n

Check failure on line 70 in app/tests/Unit/Bakery/AssetsInstallCommandTest.php

View workflow job for this annotation

GitHub Actions / PHPUnit - PHP 8.2 - SQLite

Failed asserting that '\n

Check failure on line 70 in app/tests/Unit/Bakery/AssetsInstallCommandTest.php

View workflow job for this annotation

GitHub Actions / PHPUnit - PHP 8.2 - PostgreSQL

Failed asserting that '\n

Check failure on line 70 in app/tests/Unit/Bakery/AssetsInstallCommandTest.php

View workflow job for this annotation

GitHub Actions / PHPUnit - PHP 8.1 - MariaDB

Failed asserting that '\n

Check failure on line 70 in app/tests/Unit/Bakery/AssetsInstallCommandTest.php

View workflow job for this annotation

GitHub Actions / PHPUnit - PHP 8.1 - PostgreSQL

Failed asserting that '\n

Check failure on line 70 in app/tests/Unit/Bakery/AssetsInstallCommandTest.php

View workflow job for this annotation

GitHub Actions / PHPUnit - PHP 8.3 - SQLite

Failed asserting that '\n

Check failure on line 70 in app/tests/Unit/Bakery/AssetsInstallCommandTest.php

View workflow job for this annotation

GitHub Actions / PHPUnit - PHP 8.3 - PostgreSQL

Failed asserting that '\n

Check failure on line 70 in app/tests/Unit/Bakery/AssetsInstallCommandTest.php

View workflow job for this annotation

GitHub Actions / PHPUnit - PHP 8.2 - MySQL

Failed asserting that '\n

Check failure on line 70 in app/tests/Unit/Bakery/AssetsInstallCommandTest.php

View workflow job for this annotation

GitHub Actions / PHPUnit - PHP 8.1 - MySQL

Failed asserting that '\n

Check failure on line 70 in app/tests/Unit/Bakery/AssetsInstallCommandTest.php

View workflow job for this annotation

GitHub Actions / PHPUnit - PHP 8.2 - MariaDB

Failed asserting that '\n

Check failure on line 70 in app/tests/Unit/Bakery/AssetsInstallCommandTest.php

View workflow job for this annotation

GitHub Actions / PHPUnit - PHP 8.3 - MySQL

Failed asserting that '\n
$this->assertStringContainsString('npm install', $result->getDisplay());
$this->assertStringContainsString('Dependencies Installed', $result->getDisplay());
}
Expand Down

0 comments on commit 9cb79aa

Please sign in to comment.