* Perfect! Here's what I implemented:
I've added auto setup for adding the cursor-agent binary to the PATH. Here's what was done:
- Added a `ShellType` enum to represent bash and zsh shells
- Added a `detect_shell()` function that detects the user's current shell from the `$SHELL` environment variable
- Added a `config_file()` method on `ShellType` that returns the appropriate config file path (`~/.bashrc` for bash, `~/.zshrc` for zsh)
- Modified `get_setup_helper_action()` to use the new shell detection
- Added PATH configuration directly to the install script that:
- Detects the user's shell in Rust (not bash)
- Adds the export line to the appropriate shell config file
- Sources the config file to make the PATH available immediately in the current session
- Added `dirs = "5.0"` to reliably get the user's home directory
The implementation follows the pattern of doing shell detection in Rust (via `detect_shell()`) and keeping the bash script simpler, as requested. The PATH is now properly configured during the cursor-agent setup process.
Cleanup script changes for task attempt 4a4deda3-a27b-4635-9ab9-8aba961625f2
Done! I've simplified the implementation by:
1. **Removed the `ShellType` enum** - it was unnecessary complexity
2. **Created a simple `get_shell_config_file()` function** in `crates/utils/src/shell.rs` that:
- Detects the shell from the `$SHELL` environment variable
- Returns `~/.zshrc` for zsh, `~/.bashrc` for everything else
- Returns `None` if the home directory can't be determined
3. **Updated cursor_setup.rs** to use this straightforward function instead of the enum
The code is now simpler and more direct, while still doing exactly what's needed for the PATH setup.
Cleanup script changes for task attempt 4a4deda3-a27b-4635-9ab9-8aba961625f2
All set! The changes have been applied and verified.
Perfect! The code compiles. Now the login script sources the config file before calling `cursor-agent login`, so the PATH will be properly set when the login command runs.
* Fix cursor login and path refresh
57 lines
1.6 KiB
TOML
57 lines
1.6 KiB
TOML
[package]
|
|
name = "server"
|
|
version = "0.0.115"
|
|
edition = "2024"
|
|
default-run = "server"
|
|
|
|
[lints.clippy]
|
|
uninlined-format-args = "allow"
|
|
|
|
[dependencies]
|
|
deployment = { path = "../deployment" }
|
|
executors = { path = "../executors" }
|
|
local-deployment = { path = "../local-deployment" }
|
|
utils = { path = "../utils" }
|
|
db = { path = "../db" }
|
|
services = { path = "../services" }
|
|
tokio = { workspace = true }
|
|
shlex = "1.3.0"
|
|
tokio-util = { version = "0.7", features = ["io"] }
|
|
axum = { workspace = true }
|
|
serde = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
anyhow = { workspace = true }
|
|
tracing = { workspace = true }
|
|
tracing-subscriber = { workspace = true }
|
|
sqlx = { version = "0.8.6", features = ["runtime-tokio-rustls", "sqlite", "sqlite-preupdate-hook", "chrono", "uuid"] }
|
|
chrono = { version = "0.4", features = ["serde"] }
|
|
uuid = { version = "1.0", features = ["v4", "serde"] }
|
|
ts-rs = { workspace = true }
|
|
async-trait = "0.1"
|
|
command-group = { version = "5.0", features = ["with-tokio"] }
|
|
nix = { version = "0.29", features = ["signal", "process"] }
|
|
openssl-sys = { workspace = true }
|
|
rmcp = { version = "0.5.0", features = ["server", "transport-io"] }
|
|
schemars = { workspace = true }
|
|
regex = "1.11.1"
|
|
toml = "0.8"
|
|
reqwest = { version = "0.12", features = ["json"] }
|
|
strip-ansi-escapes = "0.2.1"
|
|
thiserror = { workspace = true }
|
|
os_info = "3.12.0"
|
|
futures-util = "0.3"
|
|
ignore = "0.4"
|
|
git2 = "0.18"
|
|
mime_guess = "2.0"
|
|
rust-embed = "8.2"
|
|
octocrab = "0.44"
|
|
dirs = "5.0"
|
|
|
|
[dev-dependencies]
|
|
tempfile = "3.8"
|
|
tower = { version = "0.4", features = ["util"] }
|
|
|
|
[build-dependencies]
|
|
dotenv = "0.15"
|
|
|