From b7361d244c9c79eadf08b5dcedfc758240bbcd04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E7=82=AD?= <70026047+woodcoal@users.noreply.github.com> Date: Wed, 2 Jul 2025 09:21:58 +0800 Subject: [PATCH] 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. --- tools/lib/dependency-resolver.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/lib/dependency-resolver.js b/tools/lib/dependency-resolver.js index 09991810..ca6ad9b1 100644 --- a/tools/lib/dependency-resolver.js +++ b/tools/lib/dependency-resolver.js @@ -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; \ No newline at end of file +module.exports = DependencyResolver;