Fix pyproject.toml path handling and add error handling

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-27 08:46:12 +00:00
co-authored by whyour
parent f526d3f972
commit 023d0f1cc4
2 changed files with 12 additions and 6 deletions
+2 -2
View File
@@ -600,8 +600,8 @@ export function getInstallCommand(type: DependenceTypes, name: string): string {
// Check if it's a pyproject.toml file
if (trimmedName.endsWith('pyproject.toml')) {
// For pyproject.toml, install from the directory containing it
const dir = trimmedName.replace(/\/pyproject\.toml$/, '') || '.';
return `${command} ${dir}`;
const dir = trimmedName.replace(/\/pyproject\.toml$/, '');
return dir && dir !== 'pyproject.toml' ? `${command} ${dir}` : `${command} .`;
}
}