test(server): the ACP registry's fake uv is a fixture file, not a generated string (#15484)
Signed-off-by: Yordis Prieto <[email protected]>
This commit is contained in:
1 parent
1508552a16
commit
f870c419fc
2 files changed
+24
-26
No files matched your search
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
Reference in new issue
Block a user