mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-26 05:27:06 +00:00
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.
8 lines
364 B
TypeScript
8 lines
364 B
TypeScript
import { homedir } from "node:os";
|
|
import { join, resolve } from "node:path";
|
|
|
|
export function getProjectPath(workingDirectory: string) {
|
|
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);
|
|
} |