diff --git a/apps/server/src/provider/acp/AcpRegistrySupport.test.ts b/apps/server/src/provider/acp/AcpRegistrySupport.test.ts index a7cd5dc87eac1fb7e937702dc31a4acb926f36e3..b12b13e3a4efc737a6031004e66289479388c4f9 100644 --- a/apps/server/src/provider/acp/AcpRegistrySupport.test.ts +++ b/apps/server/src/provider/acp/AcpRegistrySupport.test.ts @@ -116,33 +116,9 @@ const makeFakeUvToolchain = Effect.fn("AcpRegistrySupport.test.makeFakeUvToolcha const logPath = path.join(rootDirectory, "uv.log"); yield* fileSystem.makeDirectory(toolchainBin, { recursive: true }); yield* fileSystem.writeFileString(logPath, ""); - yield* fileSystem.writeFileString( + yield* fileSystem.copyFile( + yield* path.fromFileUrl(new URL("./testing/AcpRegistrySupport.uv.fixture.sh", import.meta.url)), uvPath, - [ - "#!/bin/sh", - 'printf \'%s\\n\' "$*" >> "$FAKE_UV_LOG"', - 'tool_bin="${UV_TOOL_BIN_DIR:-$FAKE_UV_BIN}"', - 'executable="$tool_bin/fast-agent"', - 'printf "tool-dir=%s bin-dir=%s\\n" "$UV_TOOL_DIR" "$UV_TOOL_BIN_DIR" >> "$FAKE_UV_LOG"', - 'if [ "$1" = "tool" ] && [ "$2" = "dir" ] && [ "$3" = "--bin" ]; then', - " printf '%s\\n' \"$tool_bin\"", - " exit 0", - "fi", - 'if [ "$1" = "tool" ] && [ "$2" = "list" ]; then', - ' if [ -x "$executable" ]; then', - " printf 'fast-agent-acp v0.10.1\\n- fast-agent\\n'", - " fi", - " exit 0", - "fi", - 'if [ "$1" = "tool" ] && [ "$2" = "install" ] && [ "$3" = "--force" ]; then', - ' mkdir -p "$tool_bin"', - " printf '#!/bin/sh\\n' > \"$executable\"", - ' chmod 755 "$executable"', - " exit 0", - "fi", - "exit 64", - "", - ].join("\n"), ); yield* fileSystem.chmod(uvPath, 0o755); return { diff --git a/apps/server/src/provider/acp/testing/AcpRegistrySupport.uv.fixture.sh b/apps/server/src/provider/acp/testing/AcpRegistrySupport.uv.fixture.sh new file mode 100755 index 0000000000000000000000000000000000000000..18a456c24d15fc58f5ec252a7bd82215aa16bf99 --- /dev/null +++ b/apps/server/src/provider/acp/testing/AcpRegistrySupport.uv.fixture.sh @@ -0,0 +1,22 @@ +#!/bin/sh +printf '%s\n' "$*" >> "$FAKE_UV_LOG" +tool_bin="${UV_TOOL_BIN_DIR:-$FAKE_UV_BIN}" +executable="$tool_bin/fast-agent" +printf "tool-dir=%s bin-dir=%s\n" "$UV_TOOL_DIR" "$UV_TOOL_BIN_DIR" >> "$FAKE_UV_LOG" +if [ "$1" = "tool" ] && [ "$2" = "dir" ] && [ "$3" = "--bin" ]; then + printf '%s\n' "$tool_bin" + exit 0 +fi +if [ "$1" = "tool" ] && [ "$2" = "list" ]; then + if [ -x "$executable" ]; then + printf 'fast-agent-acp v0.10.1\n- fast-agent\n' + fi + exit 0 +fi +if [ "$1" = "tool" ] && [ "$2" = "install" ] && [ "$3" = "--force" ]; then + mkdir -p "$tool_bin" + printf '#!/bin/sh\n' > "$executable" + chmod 755 "$executable" + exit 0 +fi +exit 64