mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-12 02:37:45 +08:00
Merge pull request #42 from rhyme227/fix/cross-platform-path-handling
fix(hooks): correct cross-platform path handling in getProjectSettingsPath
This commit is contained in:
@@ -31,8 +31,8 @@ const GLOBAL_SETTINGS_PATH = join(homedir(), '.claude', 'settings.json');
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
function getProjectSettingsPath(projectPath) {
|
function getProjectSettingsPath(projectPath) {
|
||||||
const normalizedPath = projectPath.replace(/\//g, '\\').replace(/^\\([a-zA-Z])\\/, '$1:\\');
|
// path.join automatically handles cross-platform path separators
|
||||||
return join(normalizedPath, '.claude', 'settings.json');
|
return join(projectPath, '.claude', 'settings.json');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1000,8 +1000,8 @@ function writeSettingsFile(filePath, settings) {
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
function getProjectSettingsPath(projectPath) {
|
function getProjectSettingsPath(projectPath) {
|
||||||
const normalizedPath = projectPath.replace(/\//g, '\\').replace(/^\\([a-zA-Z])\\/, '$1:\\');
|
// path.join automatically handles cross-platform path separators
|
||||||
return join(normalizedPath, '.claude', 'settings.json');
|
return join(projectPath, '.claude', 'settings.json');
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========================================
|
// ========================================
|
||||||
|
|||||||
Reference in New Issue
Block a user