This commit is contained in:
2025-12-01 16:09:54 +08:00
parent 7471602ac1
commit fe272e0d27
2 changed files with 12 additions and 4 deletions

View File

@@ -26,3 +26,10 @@ export const pathExists = (path: string, type?: 'file' | 'directory') => {
return false;
}
};
export const normalizeScriptPath = (scriptPath: string): string => {
if (process.platform === 'win32') {
// 在 Windows 上将反斜杠转换为正斜杠PM2 更好地支持正斜杠
return scriptPath.replace(/\\/g, '/');
}
return scriptPath;
};