mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-31 01:37:24 +00:00
930cf6633c
fix: Additional vi.mock path corrections and prettier formatting
24 lines
869 B
TypeScript
24 lines
869 B
TypeScript
import { logger } from '../../../logger/index.ts';
|
|
import type { UpdateLockedConfig, UpdateLockedResult } from '../types.ts';
|
|
import { extractLockFileContentVersions } from './locked-version.ts';
|
|
|
|
export function updateLockedDependency(
|
|
config: UpdateLockedConfig,
|
|
): UpdateLockedResult {
|
|
const { depName, currentVersion, newVersion, lockFile, lockFileContent } =
|
|
config;
|
|
logger.debug(
|
|
`cargo.updateLockedDependency: ${depName}@${currentVersion} -> ${newVersion} [${lockFile}]`,
|
|
);
|
|
try {
|
|
const locked = extractLockFileContentVersions(lockFileContent!);
|
|
if (locked?.get(depName)?.find((version) => version === newVersion)) {
|
|
return { status: 'already-updated' };
|
|
}
|
|
return { status: 'unsupported' };
|
|
} catch (err) {
|
|
logger.debug({ err }, 'cargo.updateLockedDependency() error');
|
|
return { status: 'update-failed' };
|
|
}
|
|
}
|