navi: navi v2.0.3 panics on any input

Describe the bug I install navi v2.0.3 via homebrew, and I’m running the fish shell. It looks like it’s not finding the cheat files, as any input (git, ls) causes a panic.

To Reproduce

  1. Install using brew install denisidoro/tools/navi
  2. Run navi
  3. Enter git, press enter.

Expected behavior Built-in git cheats are resolved.

Screenshots

$ brew install denisidoro/tools/navi
==> Installing navi from denisidoro/tools
==> Downloading https://github.com/denisidoro/navi/releases/download/v2.0.3/navi-x86_64-osx.tar.gz
Already downloaded: /Users/austinjones/Library/Caches/Homebrew/downloads/cf9715a19022091baf31700a252c6b4051a927200d9466b9e5a540310f6c9195--navi-x86_64-osx.tar.gz
🍺  /usr/local/Cellar/navi/2.0.3: 28 files, 2.1MB, built in 3 seconds
$ RUST_BACKTRACE=1 navi                                                               1858ms  Wed Mar 11 15:21:02 2020
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /rustc/f3e1a954d2ead4e2fc197c7da7d71e6c61bad196/src/libcore/macros/mod.rs:15:40
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: std::panicking::rust_panic_with_hook
   6: rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::panicking::panic
   9: navi::cmds::core::main
  10: navi::main
  11: std::rt::lang_start::{{closure}}
  12: std::panicking::try::do_call
  13: __rust_maybe_catch_panic
  14: std::rt::lang_start_internal
  15: main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Versions:

  • OS: macOS Mojave
  • Shell: fish, version 3.1.0

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (8 by maintainers)

Commits related to this issue

Most upvoted comments

I found the problem:

λ ls -la /usr/local/bin | grep navi
lrwxr-xr-x    1 denis.isidoro  admin        29 Mar 11 18:04 navi -> ../Cellar/navi/2.0.3/bin/navi

The symlink created by brew isn’t absolute and it’s messing with navi internals.

While I don’t fix this, there are two solutions:

  1. removing the symlink and recreating with an absolute path (to /usr/local/Cellar/... for example)
  2. Adding export NAVI_PATH=/usr/local/Cellar/navi/2.0.3/libexec/cheats to your .bashrc-like file

I’m sorry for the inconvenience.

Closing this because the main issue seems to be fixed. I’m aware the current way navi deals with folders is error-prone but I believe we can tackle that in more specific, future issues.