xzfc / cached-nix-shell

Instant startup time for nix-shell
https://xzfc.github.io/cached-nix-shell/cached-nix-shell.1
The Unlicense
195 stars 16 forks source link

Panic when given a path to a directory with default.nix #11

Closed expipiplus1 closed 4 years ago

expipiplus1 commented 4 years ago

To reproduce:

$ RUST_BACKTRACE=1 cached-nix-shell ../
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 21, kind: Other, message: "Is a directory" }', src/libcore/result.rs:1165:5
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: std::panicking::continue_panic_fmt
   7: rust_begin_unwind
   8: core::panicking::panic_fmt
   9: core::result::unwrap_failed
  10: cached_nix_shell::shebang::parse_script
  11: cached_nix_shell::main
  12: std::rt::lang_start::{{closure}}
  13: std::panicking::try::do_call
  14: __rust_maybe_catch_panic
  15: std::rt::lang_start_internal
  16: main
  17: __libc_start_main
  18: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
xzfc commented 4 years ago

Fixed in 639173e513cb80918c51f33081300c6af5d048e0.

expipiplus1 commented 4 years ago

Thanks!