mirror of
https://github.com/sayanarijit/xplr.git
synced 2024-09-11 11:05:39 +03:00
Do not exit on permission denial
While trying to enter restricted directories, log error instead or exiting.
This commit is contained in:
parent
2e541fbf04
commit
1ffa85f30f
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -1630,7 +1630,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "xplr"
|
||||
version = "0.5.3"
|
||||
version = "0.5.4"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chrono",
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "xplr"
|
||||
version = "0.5.3" # Update config.yml, config.rs and default.nix
|
||||
version = "0.5.4" # Update config.yml, config.rs and default.nix
|
||||
authors = ["Arijit Basu <sayanarijit@gmail.com>"]
|
||||
edition = "2018"
|
||||
description = "A hackable, minimal, fast TUI file explorer"
|
||||
|
18
src/app.rs
18
src/app.rs
@ -1508,12 +1508,18 @@ impl App {
|
||||
|
||||
fn change_directory(mut self, dir: &str) -> Result<Self> {
|
||||
if PathBuf::from(dir).is_dir() {
|
||||
self.pwd = dir.to_owned();
|
||||
env::set_current_dir(&self.pwd)?;
|
||||
self.history = self.history.push(self.pwd.clone());
|
||||
self.msg_out.push_back(MsgOut::Refresh);
|
||||
};
|
||||
Ok(self)
|
||||
match env::set_current_dir(dir) {
|
||||
Ok(()) => {
|
||||
self.pwd = dir.to_owned();
|
||||
self.history = self.history.push(self.pwd.clone());
|
||||
self.msg_out.push_back(MsgOut::Refresh);
|
||||
Ok(self)
|
||||
}
|
||||
Err(e) => self.log_error(e.to_string()),
|
||||
}
|
||||
} else {
|
||||
Ok(self)
|
||||
}
|
||||
}
|
||||
|
||||
fn enter(self) -> Result<Self> {
|
||||
|
@ -665,6 +665,7 @@ impl Config {
|
||||
|
||||
pub fn is_compatible(&self) -> Result<bool> {
|
||||
let result = match self.parsed_version()? {
|
||||
(0, 5, 4) => true,
|
||||
(0, 5, 3) => true,
|
||||
(0, 5, 2) => true,
|
||||
(0, 5, 1) => true,
|
||||
@ -677,7 +678,8 @@ impl Config {
|
||||
|
||||
pub fn upgrade_notification(&self) -> Result<Option<&str>> {
|
||||
let result = match self.parsed_version()? {
|
||||
(0, 5, 3) => None,
|
||||
(0, 5, 4) => None,
|
||||
(0, 5, 3) => Some("App version updated. Fixed exit on permission denied"),
|
||||
(0, 5, 2) => Some("App version updated. Now pwd is synced with your terminal session"),
|
||||
(0, 5, 1) => Some("App version updated. Now follow symlinks using 'gf'"),
|
||||
(_, _, _) => Some("App version updated. New: added sort and filter support and some hacks: https://github.com/sayanarijit/xplr/wiki/Hacks"),
|
||||
|
@ -1,4 +1,4 @@
|
||||
version: v0.5.3
|
||||
version: v0.5.4
|
||||
general:
|
||||
show_hidden: false
|
||||
read_only: false
|
||||
|
Loading…
Reference in New Issue
Block a user