mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-15 00:56:26 +00:00
23 lines
451 B
TypeScript
23 lines
451 B
TypeScript
import Git from 'simple-git/promise';
|
|
|
|
import { UpdateDependencyConfig } from '../common';
|
|
|
|
export default async function updateDependency({
|
|
fileContent,
|
|
upgrade,
|
|
}: UpdateDependencyConfig): Promise<string | null> {
|
|
const git = Git(upgrade.localDir);
|
|
|
|
try {
|
|
await git.raw([
|
|
'submodule',
|
|
'update',
|
|
'--init',
|
|
'--remote',
|
|
upgrade.depName,
|
|
]);
|
|
return fileContent;
|
|
} catch (err) {
|
|
return null;
|
|
}
|
|
}
|