Skip to content

Commit

Permalink
fix for $PWD; bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
I60R committed Nov 22, 2022
1 parent 2d4b67b commit 783f7d2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "page"
version = "4.0.0"
version = "4.0.1"
authors = ["160R <160R@protonmail.com>"]
description = "Pager powered by neovim and inspired by neovim-remote"
repository = "https://github.com/I60R/page"
Expand Down
2 changes: 1 addition & 1 deletion PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
_pkgname=page
pkgname=${_pkgname}-git
pkgrel=1
pkgver=v4.0.0
pkgver=v4.0.1
pkgdesc='Pager powered by neovim and inspired by neovim-remote'
arch=('i686' 'x86_64')
url="https://github.com/I60R/page"
Expand Down
10 changes: 9 additions & 1 deletion src/picker/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ mod open_files {
context::EnvContext,
};

use once_cell::unsync::Lazy;
const PWD: Lazy<PathBuf> = Lazy::new(|| {
PathBuf::from(
std::env::var("PWD")
.expect("Cannot read $PWD value")
)
});

pub struct FileToOpen {
pub path: PathBuf,
pub path_string: String,
Expand All @@ -179,7 +187,7 @@ mod open_files {
let path = match std::fs::canonicalize(&path) {
Ok(canonical) => canonical,
Err(e) if e.kind() == std::io::ErrorKind::NotFound => {
PathBuf::from(path.as_ref())
PWD.join(path.as_ref())
}
Err(e) => {
log::error!(
Expand Down

0 comments on commit 783f7d2

Please sign in to comment.