mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 21:03:19 +00:00
feat(coding-agent): run npm install after cloning git repos with package.json
This commit is contained in:
parent
5c047c351d
commit
ca7be6929d
1 changed files with 10 additions and 0 deletions
|
|
@ -405,6 +405,11 @@ export class DefaultPackageManager implements PackageManager {
|
|||
if (source.ref) {
|
||||
await this.runCommand("git", ["checkout", source.ref], { cwd: targetDir });
|
||||
}
|
||||
// Install npm dependencies if package.json exists
|
||||
const packageJsonPath = join(targetDir, "package.json");
|
||||
if (existsSync(packageJsonPath)) {
|
||||
await this.runCommand("npm", ["install"], { cwd: targetDir });
|
||||
}
|
||||
}
|
||||
|
||||
private async updateGit(source: GitSource, scope: SourceScope): Promise<void> {
|
||||
|
|
@ -414,6 +419,11 @@ export class DefaultPackageManager implements PackageManager {
|
|||
return;
|
||||
}
|
||||
await this.runCommand("git", ["pull"], { cwd: targetDir });
|
||||
// Reinstall npm dependencies if package.json exists (in case deps changed)
|
||||
const packageJsonPath = join(targetDir, "package.json");
|
||||
if (existsSync(packageJsonPath)) {
|
||||
await this.runCommand("npm", ["install"], { cwd: targetDir });
|
||||
}
|
||||
}
|
||||
|
||||
private async removeGit(source: GitSource, scope: SourceScope): Promise<void> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue