Skip to content

Commit 6b4a722

Browse files
author
NewsguyTor
committed
Support running at paths with spaces/special char
Signed-off-by: NewsguyTor <newsguytor@fake.email>
1 parent ef6af65 commit 6b4a722

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

src/claude-auto-commit.js

100644100755
Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,10 +566,21 @@ Configuration:
566566
return options;
567567
}
568568

569-
if (import.meta.url === `file://${process.argv[1]}`) {
569+
// Check if this script is being run directly
570+
import { fileURLToPath } from 'url';
571+
import { pathToFileURL } from 'url';
572+
573+
const __filename = fileURLToPath(import.meta.url);
574+
const scriptPath = process.argv[1];
575+
576+
// Compare the resolved paths
577+
if (__filename === scriptPath || pathToFileURL(scriptPath).href === import.meta.url) {
570578
const options = parseArgs();
571579
const autoCommit = new ClaudeAutoCommit(options);
572-
autoCommit.run();
580+
autoCommit.run().catch(error => {
581+
console.error('Fatal error:', error);
582+
process.exit(1);
583+
});
573584
}
574585

575586
export default ClaudeAutoCommit;

0 commit comments

Comments
 (0)