fix: support Korean project paths on Windows

This commit is contained in:
2026-08-13 09:57:19 +09:00
parent c5acb77449
commit 444ddb35e6
6 changed files with 62 additions and 8 deletions

View File

@@ -8,9 +8,9 @@ import { parseArguments } from "../dist/args.js";
import { composeAgentHarness } from "../dist/harness.js";
async function createFixture(t) {
const root = await mkdtemp(path.join(os.tmpdir(), "kri-create-spring-harness-"));
const harnessRoot = path.join(root, "_________AgentHarnessBase");
const targetDir = path.join(root, "sample-server");
const root = await mkdtemp(path.join(os.tmpdir(), "kri-create-spring-한글 공백-"));
const harnessRoot = path.join(root, "_________Agent Harness 기준");
const targetDir = path.join(root, "샘플 server");
const logPath = path.join(root, "calls.jsonl");
await mkdir(path.join(harnessRoot, "dist"), { recursive: true });
await mkdir(targetDir, { recursive: true });
@@ -52,7 +52,7 @@ test("registers shared, composes, and verifies in deterministic order", async (t
.split("\n")
.map((line) => JSON.parse(line));
assert.deepEqual(calls, [
["register", "--project", "sample-server", "--path", "sample-server", "--shared"],
["register", "--project", "sample-server", "--path", "샘플 server", "--shared"],
["compose", "--project", "sample-server"],
["verify", "--project", "sample-server"],
]);

View File

@@ -0,0 +1,44 @@
import assert from "node:assert/strict";
import { mkdtemp, mkdir, readFile, rm } from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import test from "node:test";
import { fileURLToPath } from "node:url";
import { run } from "../dist/process.js";
const repositoryRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
test("keeps Gradle worker paths compatible with Windows JDK 17", async () => {
const gradleProperties = await readFile(
path.join(repositoryRoot, "templates", "base", "gradle.properties"),
"utf8",
);
const buildGradle = await readFile(
path.join(repositoryRoot, "templates", "base", "build.gradle"),
"utf8",
);
assert.doesNotMatch(
gradleProperties,
/org\.gradle\.jvmargs=.*-Dfile\.encoding=/,
"Gradle daemon encoding must remain platform-compatible for worker classpath files",
);
assert.match(buildGradle, /tasks\.withType\(JavaCompile\)[\s\S]*options\.encoding = 'UTF-8'/);
assert.match(buildGradle, /tasks\.withType\(Test\)[\s\S]*jvmArgs '-Dfile\.encoding=UTF-8'/);
assert.match(buildGradle, /tasks\.withType\(JavaExec\)[\s\S]*jvmArgs '-Dfile\.encoding=UTF-8'/);
});
test("runs a child process from a Korean path containing spaces", async (t) => {
const root = await mkdtemp(path.join(os.tmpdir(), "kri-create-spring-한글 공백-"));
const targetDir = path.join(root, "생성 프로젝트");
await mkdir(targetDir, { recursive: true });
t.after(() => rm(root, { recursive: true, force: true }));
const markerName = "실행 결과.txt";
const script = `require("node:fs").writeFileSync(${JSON.stringify(markerName)}, process.cwd(), "utf8")`;
const nodeCommand = process.platform === "win32" ? path.basename(process.execPath) : process.execPath;
await run(nodeCommand, ["-e", script], targetDir);
assert.equal(await readFile(path.join(targetDir, markerName), "utf8"), targetDir);
});