mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
refactor: replace specific character regex with comprehensive non-alphanumeric pattern
Update the regex in getProjectPath to replace all non-alphanumeric characters with dashes instead of only specific ones. This provides more robust handling of edge cases in working directory paths.
This commit is contained in:
@@ -2,7 +2,7 @@ import { homedir } from "node:os";
|
||||
import { join, resolve } from "node:path";
|
||||
|
||||
export function getProjectPath(workingDirectory: string) {
|
||||
const projectId = resolve(workingDirectory).replace(/[\\\/\.:_]/g, '-');
|
||||
const projectId = resolve(workingDirectory).replace(/[^a-zA-Z0-9]/g, '-');
|
||||
const claudeConfigDir = process.env.CLAUDE_CONFIG_DIR || join(homedir(), '.claude');
|
||||
return join(claudeConfigDir, 'projects', projectId);
|
||||
}
|
||||
Reference in New Issue
Block a user