Skip to content

Commit 639f2ce

Browse files
committed
chore: update deps
1 parent daa14a9 commit 639f2ce

File tree

3 files changed

+47
-57
lines changed

3 files changed

+47
-57
lines changed

Cargo.lock

Lines changed: 35 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ctrlc = { version = "3.4.1", features = ["termination"] }
2424
dirs = "5.0.1"
2525
serde = { version = "1.0.188", features = ["derive"] }
2626
serde_json = "1.0.106"
27-
inquire = { version = "0.2.1" }
27+
inquire = "0.6.2"
2828
eyre = "0.6.8"
2929
path-absolutize = "3.1.1"
3030
which = "4.4.2"

src/vscode.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,23 @@ use std::path::Path;
66
use std::process::Command as ChildProcess;
77
use which::which;
88

9+
#[cfg(target_os = "macos")]
10+
static DEFAULT_CODE_PATH: &str =
11+
"/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code";
12+
#[cfg(target_os = "linux")]
13+
static DEFAULT_CODE_PATH: &str = "/usr/share/code/bin/code";
14+
#[cfg(target_os = "freebsd")]
15+
static DEFAULT_CODE_PATH: &str = "/usr/share/code/bin/code";
16+
#[cfg(target_os = "windows")]
17+
static DEFAULT_CODE_PATH: &str = "C:\\Program Files\\Microsoft VS Code";
18+
919
// Open a path in file explorer
1020
pub fn open(folder: &Path) -> Result<(), Report> {
1121
let open_command = match which("code") {
1222
Ok(p) => Ok(p),
1323
Err(_) => {
1424
// Try to find VS Code in the default install location
15-
#[cfg(target_os = "macos")]
16-
let p =
17-
Path::new("/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code");
18-
#[cfg(target_os = "linux")]
19-
let p = Path::new("/usr/share/code/bin/code");
20-
#[cfg(target_os = "windows")]
21-
let p = Path::new("C:\\Program Files\\Microsoft VS Code");
25+
let p = Path::new(DEFAULT_CODE_PATH);
2226

2327
if p.exists() {
2428
Ok(p.to_path_buf())

0 commit comments

Comments
 (0)