fix: encode Windows paths correctly in addProjectManually

The regex only replaced forward slashes, causing Windows paths like
C:\Users\Eric\my_project to remain unchanged instead of being encoded
to C--Users-Eric-my-project. This caused API routes to fail.
This commit is contained in:
Eric Blanquer
2026-01-23 20:39:25 +01:00
committed by Eric Blanquer​
parent 57828653bf
commit 36094fb73f
2 changed files with 2 additions and 2 deletions

View File

@@ -1095,7 +1095,7 @@ async function addProjectManually(projectPath, displayName = null) {
}
// Generate project name (encode path for use as directory name)
const projectName = absolutePath.replace(/\//g, '-');
const projectName = absolutePath.replace(/[\\/:\s~_]/g, '-');
// Check if project already exists in config
const config = await loadProjectConfig();

View File

@@ -353,7 +353,7 @@ router.get('/clone-progress', async (req, res) => {
let githubToken = null;
if (githubTokenId) {
const token = await getGithubTokenById(parseInt(githubTokenId), req.user?.id);
const token = await getGithubTokenById(parseInt(githubTokenId), req.user.id);
if (token) {
githubToken = token.github_token;
}