Compare commits

...

3 Commits

Author SHA1 Message Date
Jordan Bentley
221cdb7f2f
Merge branch 'main' into fix/windows-compatibility-clean 2025-09-14 20:19:23 -04:00
Jordan Bentley
1d752b1d07
docs: add Windows build instructions to README
- Add note about Windows installer coming soon
- Include detailed Windows build instructions with prerequisites
- Clarify that executable is created in dist-electron directory
- Guide Windows users to build from source for now
2025-09-14 14:53:38 -04:00
cobra91
1f13d91256
fix: improve Windows compatibility for Claude Code integration
- Prioritize .cmd and .exe executables over shell scripts on Windows
- Use findExecutableInPath() to locate correct Claude executable
- Switch to double quotes for git commit messages (cross-platform compatible)
- Fixes Claude script execution issues on Windows systems
2025-09-14 14:04:06 -04:00
4 changed files with 28 additions and 7 deletions

View File

@ -81,6 +81,8 @@ When everything looks good:
- Open the DMG file and drag Crystal to your Applications folder
- On first launch, you may need to right-click and select "Open" due to macOS security settings
- **Windows**: Windows installer coming soon! For now, see [Building from Source](#building-from-source) below to build locally.
### Homebrew
```bash
brew install --cask stravu-crystal
@ -102,11 +104,29 @@ pnpm run electron-dev
## Building for Production
### macOS
```bash
# Build for macOS
pnpm build:mac
```
### Windows
```bash
# Prerequisites:
# - Node.js and pnpm installed
# - Git installed and configured
# - Claude Code installed (`npm install -g @anthropic-ai/claude-code`)
# Clone and setup
git clone https://github.com/stravu/crystal.git
cd crystal
pnpm run setup
# Build for Windows
pnpm build:win
```
The Windows build will create an executable in the `dist-electron` directory. A Windows installer (.exe) will be available in future releases.
## 🤝 Contributing

View File

@ -93,9 +93,9 @@ export class CommitManager extends EventEmitter {
const fullMessage = prefix + commitMessage;
// For checkpoint mode, use a simple commit without the extra signature
// Escape the message properly for the shell
const escapedMessage = fullMessage.replace(/'/g, "'\\''");
const commitCommand = `git commit -m '${escapedMessage}' --no-verify`;
// Use double quotes which work better cross-platform
const escapedMessage = fullMessage.replace(/"/g, '\\"');
const commitCommand = `git commit -m "${escapedMessage}" --no-verify`;
const result = execSync(commitCommand, { cwd: worktreePath, encoding: 'utf8' });
// Extract commit hash from output

View File

@ -189,7 +189,7 @@ export async function testClaudeCodeInDirectory(directory: string, customClaudeP
const timeout = os.platform() === 'linux' ? 3000 : 10000; // Shorter timeout for Linux
// Use custom path if provided, otherwise use 'claude' which will be found in PATH
const claudeCommand = customClaudePath || 'claude';
const claudeCommand = customClaudePath || findExecutableInPath('claude') || 'claude';
console.log(`[ClaudeTest] Running '${claudeCommand} --help' in ${directory} with timeout ${timeout}ms...`);
const { stdout, stderr } = await execAsync(`"${claudeCommand}" --help`, {

View File

@ -366,8 +366,9 @@ export function findExecutableInPath(executable: string): string | null {
console.log(`[ShellPath] Searching in ${paths.length} PATH directories`);
// On Windows, executables might have .exe, .cmd, or .bat extensions
const executableNames = isWindows
? [executable, `${executable}.exe`, `${executable}.cmd`, `${executable}.bat`]
// Prioritize .cmd and .exe over shell scripts on Windows
const executableNames = isWindows
? [`${executable}.cmd`, `${executable}.exe`, `${executable}.bat`, executable]
: [executable];
let searchedPaths = 0;