Skip to content

Commit 565d564

Browse files
committed
Rename extension to cwc and add global storage migration
- we want to migrate the extension to a new publisher and name: from `robertpiosik.gemini-coder` to `codewebchat.cwc`. after installation, before calling e.g. `codium --uninstall-extension robertpiosik.gemini-coder`, we need to migrate global storage, e.g. `/Users/robert/Library/Application Support/Code/User/globalStorage/robertpiosik.gemini-coder` to `/Users/robert/Library/Application Support/Code/User/globalStorage/codewebchat.cwc`
1 parent 97a9c09 commit 565d564

3 files changed

Lines changed: 49 additions & 2 deletions

File tree

‎apps/editor/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "gemini-coder",
2+
"name": "cwc",
33
"displayName": "Code Web Chat",
44
"description": "Markdown prompts for chatbots, APIs, and CLIs with seamless integration",
55
"version": "2026.1107.399",
@@ -13,7 +13,7 @@
1313
"test": "jest",
1414
"test:watch": "jest --watch"
1515
},
16-
"publisher": "robertpiosik",
16+
"publisher": "codewebchat",
1717
"homepage": "https://cwc.dev/",
1818
"repository": {
1919
"type": "git",

‎install.ps1‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,27 @@ foreach ($i in $indices) {
525525

526526
$ok = Invoke-Step "$msg_step_install $($editor.Name)..." {
527527
& $editor.Cmd --install-extension $vsixFile.FullName --force *>$null
528+
529+
# Migrate global storage from old extension ID to new one
530+
$oldId = "robertpiosik.gemini-coder"
531+
$newId = "codewebchat.cwc"
532+
$appData = $env:APPDATA
533+
if (Test-Path $appData) {
534+
foreach ($appDir in Get-ChildItem -Path $appData -Directory) {
535+
$oldPath = Join-Path $appDir.FullName "User\globalStorage\$oldId"
536+
$newPath = Join-Path $appDir.FullName "User\globalStorage\$newId"
537+
if (Test-Path $oldPath) {
538+
if (-not (Test-Path $newPath)) {
539+
New-Item -ItemType Directory -Path $newPath -Force | Out-Null
540+
}
541+
Copy-Item -Path "$oldPath\*" -Destination $newPath -Recurse -Force -ErrorAction SilentlyContinue
542+
Remove-Item -Path $oldPath -Recurse -Force -ErrorAction SilentlyContinue
543+
}
544+
}
545+
}
546+
547+
# Uninstall old extension
548+
& $editor.Cmd --uninstall-extension $oldId *>$null
528549
}
529550

530551
Write-Host ""

‎install.sh‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,32 @@ for i in "${indices[@]}"; do
555555
echo ""
556556
echo "$msg_error $msg_install_fail $editor_name."
557557
else
558+
# Migrate global storage and uninstall old extension
559+
old_id="robertpiosik.gemini-coder"
560+
new_id="codewebchat.cwc"
561+
config_base=""
562+
if [ "$(uname)" = "Darwin" ]; then
563+
config_base="$HOME/Library/Application Support"
564+
else
565+
config_base="${XDG_CONFIG_HOME:-$HOME/.config}"
566+
fi
567+
568+
if [ -d "$config_base" ]; then
569+
for app_dir in "$config_base"/*; do
570+
if [ -d "$app_dir" ]; then
571+
old_path="$app_dir/User/globalStorage/$old_id"
572+
new_path="$app_dir/User/globalStorage/$new_id"
573+
if [ -d "$old_path" ]; then
574+
mkdir -p "$new_path"
575+
cp -a "$old_path"/. "$new_path"/ 2>/dev/null || true
576+
rm -rf "$old_path"
577+
fi
578+
fi
579+
done
580+
fi
581+
582+
"$editor_cmd" --uninstall-extension "$old_id" >/dev/null 2>&1 || true
583+
558584
echo ""
559585
if [ "$is_update" = false ]; then
560586
echo "$msg_success $editor_name!"

0 commit comments

Comments
 (0)