Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/claude-auto-commit.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -566,10 +566,21 @@ Configuration:
return options;
}

if (import.meta.url === `file://${process.argv[1]}`) {
// Check if this script is being run directly
import { fileURLToPath } from 'url';
import { pathToFileURL } from 'url';

const __filename = fileURLToPath(import.meta.url);
const scriptPath = process.argv[1];

// Compare the resolved paths
if (__filename === scriptPath || pathToFileURL(scriptPath).href === import.meta.url) {
const options = parseArgs();
const autoCommit = new ClaudeAutoCommit(options);
autoCommit.run();
autoCommit.run().catch(error => {
console.error('Fatal error:', error);
process.exit(1);
});
}

export default ClaudeAutoCommit;