Skip to content

Commit

Permalink
refactor(composer): use update for lock file maintenance (renovatebot…
Browse files Browse the repository at this point in the history
  • Loading branch information
bobvandevijver authored Oct 19, 2021
1 parent 5434a9d commit 28779c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/manager/composer/__snapshots__/artifacts.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Array [
exports[`manager/composer/artifacts performs lockFileMaintenance 1`] = `
Array [
Object {
"cmd": "composer install --ignore-platform-reqs --no-ansi --no-interaction --no-scripts --no-autoloader --no-plugins",
"cmd": "composer update --ignore-platform-reqs --no-ansi --no-interaction --no-scripts --no-autoloader --no-plugins",
"options": Object {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down
9 changes: 2 additions & 7 deletions lib/manager/composer/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import * as datasourcePackagist from '../../datasource/packagist';
import { logger } from '../../logger';
import { ExecOptions, exec } from '../../util/exec';
import {
deleteLocalFile,
ensureCacheDir,
ensureLocalDir,
getSiblingFileName,
Expand Down Expand Up @@ -102,10 +101,6 @@ export async function updateArtifacts({
...config.constraints,
};

if (config.isLockFileMaintenance) {
await deleteLocalFile(lockFileName);
}

const preCommands: string[] = [
`install-tool composer ${await getComposerConstraint(constraints)}`,
];
Expand All @@ -126,7 +121,7 @@ export async function updateArtifacts({
const cmd = 'composer';
let args: string;
if (config.isLockFileMaintenance) {
args = 'install';
args = 'update';
} else {
args =
(
Expand Down Expand Up @@ -166,7 +161,7 @@ export async function updateArtifacts({
return res;
}

logger.debug(`Commiting vendor files in ${vendorDir}`);
logger.debug(`Committing vendor files in ${vendorDir}`);
for (const f of [...status.modified, ...status.not_added]) {
if (f.startsWith(vendorDir)) {
res.push({
Expand Down

0 comments on commit 28779c6

Please sign in to comment.