Update dependency-resolver.js (#286)

When cloning a project in a Windows environment, Git may automatically convert line endings from `\n` to `\r\n`. This can cause a mismatch in the `yaml` configuration, leading to a build failure. To resolve this, a step has been added to enforce the replacement of `\r` characters, ensuring the build can proceed normally.
This commit is contained in:
木炭
2025-07-02 09:21:58 +08:00
committed by GitHub
parent b2f8525bbf
commit b7361d244c

View File

@@ -15,7 +15,7 @@ class DependencyResolver {
const agentContent = await fs.readFile(agentPath, 'utf8');
// Extract YAML from markdown content
const yamlMatch = agentContent.match(/```ya?ml\n([\s\S]*?)\n```/);
const yamlMatch = agentContent.replace(/\r/g, "").match(/```ya?ml\n([\s\S]*?)\n```/);
if (!yamlMatch) {
throw new Error(`No YAML configuration found in agent ${agentId}`);
}
@@ -191,4 +191,4 @@ class DependencyResolver {
}
}
module.exports = DependencyResolver;
module.exports = DependencyResolver;