Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions docs/releases.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Release Notes

## v2.2.3

> **Release Date**: 2026-01-31
> **Focus**: Cross-Platform Compatibility (Sync Command)

### 🔧 Improvements

- **Windows Compatibility**: Fixed `sync` command to work correctly on Windows by using `path.basename()` instead of Unix-style path splitting for repository name extraction.
- **Shell Escaping**: Updated shell argument escaping to use double quotes instead of single quotes for better cross-platform compatibility.

---

## v2.2.2

> **Release Date**: 2026-01-18
Expand Down
6 changes: 4 additions & 2 deletions src/commands/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import chalk from 'chalk';
import inquirer from 'inquirer';
import ora from 'ora';
import { config } from '../storage/config.js';
import path from 'path';

function sanitizeRepoName(name: string): string {
return name.replace(/[^a-zA-Z0-9_-]/g, '-').replace(/--+/g, '-');
Expand All @@ -16,9 +17,10 @@ function isValidGitUrl(url: string): boolean {
}

function escapeShellArg(arg: string): string {
return `'${arg.replace(/'/g, "'\\''")}'`;
return `"${arg.replace(/"/g, '\\"')}"`;
}


function isGitInstalled(): boolean {
try {
execSync('git --version', { stdio: 'ignore' });
Expand Down Expand Up @@ -101,7 +103,7 @@ async function setupRemote(workDir: string): Promise<string> {
if (createGh) {
spinner.start('Creating GitHub repository...');
try {
const rawRepoName = workDir.split('/').pop() || 'leetcode-solutions';
const rawRepoName = path.basename(workDir) || 'leetcode-solutions';
const repoName = sanitizeRepoName(rawRepoName);
execSync(`gh repo create ${repoName} --private --source=. --remote=origin`, {
cwd: workDir,
Expand Down
Loading