We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef6af65 commit 6b4a722Copy full SHA for 6b4a722
1 file changed
src/claude-auto-commit.js
100644
100755
@@ -566,10 +566,21 @@ Configuration:
566
return options;
567
}
568
569
-if (import.meta.url === `file://${process.argv[1]}`) {
+// 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) {
578
const options = parseArgs();
579
const autoCommit = new ClaudeAutoCommit(options);
- autoCommit.run();
580
+ autoCommit.run().catch(error => {
581
+ console.error('Fatal error:', error);
582
+ process.exit(1);
583
+ });
584
585
586
export default ClaudeAutoCommit;
0 commit comments