Skip to content
This repository was archived by the owner on Apr 14, 2025. It is now read-only.

Commit b83c741

Browse files
committed
feat: ✨ add direct script execution method
1 parent 8470dde commit b83c741

File tree

5 files changed

+95
-2
lines changed

5 files changed

+95
-2
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 isboyjc
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,21 @@ A tool for resetting the trial period of the Cursor Editor.
1818

1919
## Usage
2020

21-
### Download Executable
21+
### Method 1: Direct Script Execution
22+
23+
#### Windows PowerShell
24+
25+
```powershell
26+
irm https://raw.githubusercontent.com/isboyjc/cursor-reset/main/scripts/reset.ps1 | iex
27+
```
28+
29+
#### macOS/Linux
30+
31+
```bash
32+
curl -fsSL https://raw.githubusercontent.com/isboyjc/cursor-reset/main/scripts/reset.sh | sh
33+
```
34+
35+
### Method 2: Download Executable
2236

2337
1. Go to our [releases page](https://github.com/isboyjc/cursor-reset/releases)
2438
2. Download the version for your operating system:

README_zh-CN.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,21 @@ Cursor 编辑器试用期重置工具
1818

1919
## 使用方法
2020

21-
### 下载可执行文件
21+
### 方式一:直接执行脚本
22+
23+
#### Windows PowerShell
24+
25+
```powershell
26+
irm https://raw.githubusercontent.com/isboyjc/cursor-reset/main/scripts/reset.ps1 | iex
27+
```
28+
29+
#### macOS/Linux
30+
31+
```bash
32+
curl -fsSL https://raw.githubusercontent.com/isboyjc/cursor-reset/main/scripts/reset.sh | sh
33+
```
34+
35+
### 方式二:下载可执行文件
2236

2337
1. 访问 [releases 页面](https://github.com/isboyjc/cursor-reset/releases)
2438
2. 下载对应系统的版本:

scripts/reset.ps1

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# 获取用户配置目录
2+
$configDir = "$env:APPDATA\Cursor"
3+
4+
# 检查目录是否存在
5+
if (-not (Test-Path $configDir)) {
6+
Write-Host "Cursor 配置目录不存在"
7+
exit 1
8+
}
9+
10+
# 删除试用相关文件
11+
Remove-Item -Path "$configDir\Local Storage" -Recurse -Force -ErrorAction SilentlyContinue
12+
Remove-Item -Path "$configDir\Session Storage" -Recurse -Force -ErrorAction SilentlyContinue
13+
14+
Write-Host "✨ Cursor 试用期已重置"
15+
Write-Host "🎉 重启 Cursor 编辑器即可开始新的试用期"

scripts/reset.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
# 获取用户主目录
4+
HOME_DIR="$HOME"
5+
6+
# 定义 Cursor 配置目录
7+
if [[ "$OSTYPE" == "darwin"* ]]; then
8+
# macOS
9+
CONFIG_DIR="$HOME_DIR/Library/Application Support/Cursor"
10+
elif [[ "$OSTYPE" == "linux"* ]]; then
11+
# Linux
12+
CONFIG_DIR="$HOME_DIR/.config/Cursor"
13+
else
14+
echo "不支持的操作系统"
15+
exit 1
16+
fi
17+
18+
# 检查目录是否存在
19+
if [ ! -d "$CONFIG_DIR" ]; then
20+
echo "Cursor 配置目录不存在"
21+
exit 1
22+
fi
23+
24+
# 删除试用相关文件
25+
rm -rf "$CONFIG_DIR/Local Storage"
26+
rm -rf "$CONFIG_DIR/Session Storage"
27+
28+
echo "✨ Cursor 试用期已重置"
29+
echo "🎉 重启 Cursor 编辑器即可开始新的试用期"

0 commit comments

Comments
 (0)