Skip to content

Commit 4486e6c

Browse files
committed
fix: 修复 classPathString 的路径格式化,确保在不同平台下正确处理路径
1 parent ef4fbe5 commit 4486e6c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { resolve } from 'path';
1+
import path, { resolve } from 'path';
22
import { writeFileSync } from 'fs';
33
import getMavenModules from "./find-maven-modules";
44
import { buildClasspath } from './classpath-builder';
@@ -112,7 +112,7 @@ async function main() {
112112
console.log('项目完整依赖数:', fullClasspath.length);
113113
const classpathFile = resolve(".cache", "classpath.cache");
114114

115-
const classPathString = fullClasspath.map((item) => `file:/${item.replace(/\\/g, '/')}`).join(' ')
115+
const classPathString = fullClasspath.map((item) => `file://${path.normalize(item).replace(/\\/g, '/')}`).join(' ')
116116
const fullString = `Class-Path: ${classPathString}`;
117117
const lines: string[] = [];
118118
let remaining = fullString;

0 commit comments

Comments
 (0)