renovate/lib/manager/git-submodules/update.ts

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;
}
}