Skip to content

Support running at paths with spaces/special char#2

Open
NewsGuyTor wants to merge 1 commit into0xkaz:mainfrom
NewsGuyTor:main
Open

Support running at paths with spaces/special char#2
NewsGuyTor wants to merge 1 commit into0xkaz:mainfrom
NewsGuyTor:main

Conversation

@NewsGuyTor
Copy link

So I experienced #1 too, couldn't get the script to run at all. Claude managed to find and fix the error:

Description:
The claude-auto-commit script fails to execute when installed in directories containing
spaces or special characters (like "Mobile Documents" or paths with ~). This is due to the
URL encoding mismatch in the entry point check.

Problem:
The comparison import.meta.url === \file://${process.argv[1]}`` fails because:

  • import.meta.url returns properly URL-encoded paths (spaces as %20, ~ as %7E)
  • process.argv[1] contains the raw filesystem path
  • Direct string concatenation doesn't handle URL encoding

Solution:
Use Node's fileURLToPath and pathToFileURL utilities to properly compare file paths
regardless of special characters.

Signed-off-by: NewsguyTor <newsguytor@fake.email>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant