Skip to content

Commit

Permalink
fix: running glazewm without arguments in shell causes infinite ope…
Browse files Browse the repository at this point in the history
…ning and closing
  • Loading branch information
lars-berger committed Jan 28, 2025
1 parent d574060 commit 374e004
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/wm-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ async fn main() -> anyhow::Result<()> {

match app_command {
AppCommand::Start { .. } => {
let exe_dir = env::current_exe()?
let exe_path = env::current_exe()?;
let exe_dir = exe_path
.parent()
.context("Failed to resolve path to the current executable.")?
.to_owned();
Expand All @@ -21,7 +22,7 @@ async fn main() -> anyhow::Result<()> {
let main_path =
[exe_dir.join("glazewm.exe"), exe_dir.join("../glazewm.exe")]
.into_iter()
.find(|path| path.exists())
.find(|path| path.exists() && *path != exe_path)
.and_then(|path| path.to_str().map(ToString::to_string))
.context("Failed to resolve path to the main executable.")?;

Expand Down

0 comments on commit 374e004

Please sign in to comment.