Browse Source
Merge pull request #262 from zuoyexingchen/master
Bugfix: 修复删除 cursor-updater 目录失败的问题
pull/286/head
v0.0.118
煎饼果子卷鲨鱼辣椒
3 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
16 additions and
8 deletions
-
scripts/run/cursor_win_id_modifier.ps1
|
|
@ -399,17 +399,25 @@ try { |
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
# 删除现有目录 |
|
|
|
# 检查cursor-updater是否存在 |
|
|
|
if (Test-Path $updaterPath) { |
|
|
|
try { |
|
|
|
Remove-Item -Path $updaterPath -Force -Recurse -ErrorAction Stop |
|
|
|
Write-Host "$GREEN[信息]$NC 成功删除 cursor-updater 目录" |
|
|
|
} |
|
|
|
catch { |
|
|
|
Write-Host "$RED[错误]$NC 删除 cursor-updater 目录失败" |
|
|
|
Show-ManualGuide |
|
|
|
# 如果是文件,说明已经创建了阻止更新 |
|
|
|
if ((Get-Item $updaterPath) -is [System.IO.FileInfo]) { |
|
|
|
Write-Host "$GREEN[信息]$NC 已创建阻止更新文件,无需再次阻止" |
|
|
|
return |
|
|
|
} |
|
|
|
# 如果是目录,尝试删除 |
|
|
|
else { |
|
|
|
try { |
|
|
|
Remove-Item -Path $updaterPath -Force -Recurse -ErrorAction Stop |
|
|
|
Write-Host "$GREEN[信息]$NC 成功删除 cursor-updater 目录" |
|
|
|
} |
|
|
|
catch { |
|
|
|
Write-Host "$RED[错误]$NC 删除 cursor-updater 目录失败" |
|
|
|
Show-ManualGuide |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
# 创建阻止文件 |
|
|
|